新增商品 编辑商品

  1. <template>
  2. <div class="home">
  3. <Holstein></Holstein>
  4. <div class="merchantRegist">
  5. <div class="merchantRegistration">
  6. <div class="addTitle">{{pageTitle}}</div>
  7. <el-steps :active="activeIndex - 0" align-center process-status="process" finish-status="success">
  8. <el-step title="基本信息填写" ></el-step>
  9. <el-step title="售卖信息填写" ></el-step>
  10. <el-step title="常见问题与需求" ></el-step>
  11. <el-step title="提交完成" ></el-step>
  12. </el-steps>
  13. <el-tabs v-model="activeIndex">
  14. <el-tab-pane label="" name="0">
  15. <div class="stepsContent">
  16. <div data-v-a72aa574="" class="" style="">
  17. <div class="el-card__body" style="">
  18. <el-form
  19. data-v-a72aa574=""
  20. class="el-form"
  21. style=""
  22. :model="addform"
  23. :rules="rulesadd"
  24. ref="addform"
  25. >
  26. <div
  27. data-v-a72aa574=""
  28. class="el-row"
  29. style="margin-left: -12px; margin-right: -12px"
  30. >
  31. <!-- 商品类目 -->
  32. <el-col :span="12">
  33. <el-form-item
  34. class="el-form-item is-required el-form-item--small"
  35. label="商品类目"
  36. prop="categoryId"
  37. >
  38. <div
  39. class="el-form-item__content"
  40. style="margin-left: 130px"
  41. >
  42. <el-cascader
  43. v-model="addform.categoryId"
  44. :props="{
  45. value: 'id',
  46. label: 'cateName',
  47. children: 'children'
  48. }"
  49. :options="NavTitle"
  50. @change="handleChange"
  51. ></el-cascader>
  52. </div>
  53. </el-form-item>
  54. </el-col>
  55. <!-- 商品名称 -->
  56. <el-col :span="12">
  57. <el-form-item
  58. data-v-a72aa574=""
  59. class="el-form-item is-required el-form-item--small"
  60. label="商品名称"
  61. prop="serviceName"
  62. >
  63. <div
  64. class="el-form-item__content"
  65. style="margin-left: 130px"
  66. >
  67. <el-input
  68. v-model="addform.serviceName"
  69. placeholder="请输入商品名称"
  70. ></el-input>
  71. </div>
  72. </el-form-item>
  73. </el-col>
  74. <!-- 商品排序 -->
  75. <el-col :span="12">
  76. <el-form-item
  77. data-v-a72aa574=""
  78. class="el-form-item is-required el-form-item--small"
  79. label="商品排序"
  80. prop="serviceSort"
  81. >
  82. <div
  83. class="el-form-item__content"
  84. style="margin-left: 130px"
  85. >
  86. <el-col :span="10">
  87. <el-input
  88. v-model="addform.serviceSort"
  89. placeholder="请输入商品排序"
  90. oninput="if(value>99)value=99;if(value.length>2)value=value.slice(0,2);if(value<1 && value)value=1"></el-input>
  91. </el-col>
  92. </div>
  93. </el-form-item>
  94. </el-col>
  95. <!-- 商品库存 -->
  96. <el-col :span="12">
  97. <el-form-item
  98. data-v-a72aa574=""
  99. class="el-form-item is-required el-form-item--small"
  100. label="可接单量"
  101. prop="orderQuantity"
  102. >
  103. <div
  104. class="el-form-item__content"
  105. style="margin-left: 130px"
  106. >
  107. <el-input
  108. v-model="addform.orderQuantity"
  109. type="number"
  110. oninput="if(value>99999)value=99999;if(value.length>5)value=value.slice(0,5);if(value<1 && value)value=1"
  111. placeholder="请输入可接单量"
  112. ></el-input>
  113. </div>
  114. </el-form-item>
  115. </el-col>
  116. </div>
  117. <!-- 商品展示材料 -->
  118. <el-col :span="24">
  119. <el-form-item
  120. data-v-a72aa574=""
  121. class="el-form-item is-required el-form-item--small"
  122. label="商品展示材料(图片/视频)"
  123. prop="filesTwo"
  124. >
  125. <div class="el-form-item__content" style="">
  126. <div
  127. data-v-a72aa574=""
  128. class="el-textarea el-input--small"
  129. style="padding-left: 50px"
  130. >
  131. <div>注:</div>
  132. <div>1、商品logo优先级为:视频>第一张图片</div>
  133. <div>
  134. 2、请务必上传商品图片,默认第一张为封面图;图片最多上传19张,格式为jpgJPEGpng
  135. </div>
  136. <div>
  137. 3、视频最多上传一个,格式为AMmovmvbrmFLVmp4
  138. </div>
  139. </div>
  140. </div>
  141. </el-form-item>
  142. </el-col>
  143. <el-col :span="24">
  144. <el-form-item
  145. data-v-a72aa574=""
  146. class="el-form-item el-form-item--small"
  147. label="上传介绍视频"
  148. >
  149. <el-upload class="avatar-uploader"
  150. drag
  151. action="http://yshopapi.inroyltd.com/api/uploadVideo"
  152. :show-file-list="false"
  153. accept=".mp4,.am,.mov,.mvb,.rm,.flv"
  154. :on-success="handleVideoSuccess"
  155. :on-remove="handleContvideoRemove"
  156. :before-upload="beforeUploadVideo"
  157. :on-progress="uploadVideoProcess">
  158. <video v-if="addform.Video && videoFlag == false" :src="domain + addform.Video" class="videoBox" controls="controls">您的浏览器不支持视频播放</video>
  159. <template v-else-if="!addform.Video && videoFlag == false">
  160. <i class="el-icon-upload"></i>
  161. <div class="el-upload__text">视频最多上传一个,格式为AMmovmvbrmFLVmp4</div>
  162. </template>
  163. <el-progress v-if="videoFlag == true" type="circle" :percentage="videoUploadPercent" style="margin-top:30px;"></el-progress>
  164. </el-upload>
  165. <div class="el-upload__tip" slot="tip">
  166. 只能上传<span style="color: #cc0000"
  167. >一个MP4</span
  168. >文件
  169. </div>
  170. </el-form-item>
  171. </el-col>
  172. <el-col :span="24">
  173. <el-form-item
  174. class="el-form-item el-form-item--small"
  175. label="上传介绍图片"
  176. label-width="100px"
  177. >
  178. <div class="el-form-item__content" style="">
  179. <div data-v-1c9bbdc3="" data-v-a72aa574="">
  180. <el-upload
  181. action="action"
  182. list-type="picture-card"
  183. accept=".jpg,.jpeg,.png"
  184. :on-preview="handleContImgPreview"
  185. :on-remove="handleContImgRemove"
  186. :before-upload="beforeUploadImage"
  187. :limit="19"
  188. :on-exceed="exceedTips"
  189. :http-request="uploadImage"
  190. :file-list="addform.imgs2"
  191. >
  192. <i class="el-icon-plus"></i>
  193. </el-upload>
  194. <el-dialog
  195. :visible.sync="dialogContImgVisible"
  196. append-to-body
  197. >
  198. <img width="100%" :src="dialogContImgUrl" />
  199. </el-dialog>
  200. </div>
  201. </div>
  202. </el-form-item>
  203. </el-col>
  204. <!-- 商品描述 -->
  205. <el-col :span="24">
  206. <el-form-item
  207. class="el-form-item is-required el-form-item--small"
  208. label="商品描述"
  209. prop="serviceDesc"
  210. >
  211. <span style="color: red; font-size: 14px; line-height: 32px"
  212. >(2000个字)</span
  213. >
  214. <div class="el-form-item__content" style="padding-bottom:50px">
  215. <!--<el-input
  216. type="textarea"
  217. v-model="addform.serviceDesc"
  218. ></el-input>-->
  219. <quill-editor v-model="addform.serviceDesc" ref="myQuillEditor" style="height: 300px;" :options="editorOption"> </quill-editor>
  220. </div>
  221. </el-form-item>
  222. </el-col>
  223. </el-form>
  224. </div>
  225. </div>
  226. </div>
  227. <div class="nextStepBtn">
  228. <el-button
  229. style="margin-top: 12px; color: #fff; background: #81d8d0"
  230. @click="submitaddbasic('addform')"
  231. >下一步</el-button
  232. >
  233. </div>
  234. </el-tab-pane>
  235. <el-tab-pane label="" name="1">
  236. <div class="multiFlex" style="display:flex;justify-content:space-between;align-items:center;margin-top:30px">
  237. <div class="addTitle">商品价格定制</div>
  238. <el-select v-model="settingValue" placeholder="请选择">
  239. <el-option
  240. v-for="item in setting"
  241. :key="item.value"
  242. :label="item.label"
  243. :value="item.value">
  244. </el-option>
  245. </el-select>
  246. </div>
  247. <div class="stepsContent1">
  248. <div style="margin-top: 20px; background-color: #eeeeee">
  249. <div class="tableTitle" style="background-color: #fff; margin: 0; padding:40px 0 18px">配置参数</div>
  250. <div class="tableInfro">
  251. <!-- <table cellspacing="0" cellpadding="0" border class="el-table__header" style="background-color: #fff;width: 1280px">
  252. <tbody style="text-align:center;">
  253. <tr class="" style="background:#eeeeee;height:60px;line-height:60px;font-size:16px">
  254. <th rowspan="1" style="background:#eeeeee;width:320px;"></th>
  255. <th>基础</th>
  256. <th>标准</th>
  257. <th>优质</th>
  258. </tr>
  259. </tbody>
  260. </table> -->
  261. <el-table
  262. :data="pricesCustoms">
  263. <el-table-column label="" prop="title">
  264. <template slot-scope="scope">
  265. <el-row v-if="scope.$index < 5 || scope.row.title == '价格'">
  266. <p style="margin-left:40px;display:inline-block">{{scope.row.title}}</p>
  267. </el-row>
  268. <el-row v-else>
  269. <el-row style="display:flex;align-items: center;">
  270. <!-- <div style="margin-left:40px;display:inline-block"> -->
  271. <el-col :span="12">
  272. <el-input v-model="scope.row.title" placeholder="请填写配置参数名"></el-input>
  273. </el-col>
  274. <!-- </div> -->
  275. <el-col :span="12">
  276. <el-switch style="margin-left:2px;display:inline-block"
  277. v-model="scope.row.isText"
  278. :active-value="1"
  279. :inactive-value="0"
  280. active-text="文本"
  281. @change="changeText(scope.row,scope.$index)">
  282. </el-switch>
  283. </el-col>
  284. </el-row>
  285. </el-row>
  286. </template>
  287. </el-table-column>
  288. <el-table-column label="基础">
  289. <template slot-scope="scope" >
  290. <el-row v-if="scope.row.title == '交付时间'">
  291. <el-select v-model="scope.row.oneValue" placeholder="请选择交付时间" style="float:left;width:100%">
  292. <el-option
  293. v-for="item in deliverTime"
  294. :key="item.value"
  295. :label="item.label"
  296. :value="item.value"></el-option>
  297. </el-select>
  298. </el-row>
  299. <el-row v-else-if="scope.row.title == '可修改次数'">
  300. <el-input v-model="scope.row.oneValue" placeholder="请输入可修改次数" type="number"></el-input>
  301. </el-row>
  302. <el-row v-else-if="scope.row.title == '商品数量'">
  303. <el-input v-model="scope.row.oneValue" placeholder="请输入商品数量" type="number"></el-input>
  304. </el-row>
  305. <el-row v-else-if="scope.row.title == '价格'">
  306. <el-input v-model="scope.row.oneValue" placeholder="请输入价格" onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  307. </el-row>
  308. <el-row v-else>
  309. <template v-if="scope.row.isText > 0">
  310. <el-col :span="16">
  311. <el-input v-model="scope.row.oneValue" placeholder="请输入服务名" v-if="scope.row.title == '服务名'"></el-input>
  312. <el-input v-model="scope.row.oneValue" placeholder="请输入服务描述" v-else-if="scope.row.title == '服务描述'"></el-input>
  313. <el-input v-model="scope.row.oneValue" placeholder="请输入配置参数" v-else></el-input>
  314. </el-col>
  315. </template>
  316. <template v-else>
  317. <el-col :span="16">
  318. <el-checkbox v-model="scope.row.oneValue" true-label="true" false-label="false" style="margin:10px 0 0 15px" ></el-checkbox>
  319. </el-col>
  320. </template>
  321. <el-col :span="6" class="editBtn" v-if="scope.row.customSort > 5 && scope.row.title !== '价格' && settingValue == 1" style="margin-left:10px">
  322. <el-button type="text" @click="addCustomeLine(scope.row,scope.$index)">增加</el-button>
  323. <el-button type="text" @click="delCustomeLine(scope.$index,2)" v-if="scope.$index > 5">删除</el-button>
  324. </el-col>
  325. </el-row>
  326. </template>
  327. </el-table-column>
  328. <el-table-column label="标准">
  329. <template slot-scope="scope">
  330. <el-row v-if="scope.row.title == '交付时间'">
  331. <el-select v-model="scope.row.secondValue" placeholder="请选择交付时间" style="float:left;width:100%">
  332. <el-option
  333. v-for="item in deliverTime"
  334. :key="item.value"
  335. :label="item.label"
  336. :value="item.value"></el-option>
  337. </el-select>
  338. </el-row>
  339. <el-row v-else-if="scope.row.title == '可修改次数'">
  340. <el-input v-model="scope.row.secondValue" placeholder="请输入可修改次数" type="number"></el-input>
  341. </el-row>
  342. <el-row v-else-if="scope.row.title == '商品数量'">
  343. <el-input v-model="scope.row.secondValue" placeholder="请输入商品数量" type="number"></el-input>
  344. </el-row>
  345. <el-row v-else-if="scope.row.title == '价格'">
  346. <el-input v-model="scope.row.secondValue" placeholder="请输入价格" onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  347. </el-row>
  348. <el-row v-else>
  349. <template v-if="scope.row.isText > 0">
  350. <el-col :span="16">
  351. <el-input v-model="scope.row.secondValue" placeholder="请输入服务名" v-if="scope.row.title == '服务名'"></el-input>
  352. <el-input v-model="scope.row.secondValue" placeholder="请输入服务描述" v-else-if="scope.row.title == '服务描述'"></el-input>
  353. <el-input v-model="scope.row.secondValue" placeholder="请输入配置参数" v-else></el-input>
  354. </el-col>
  355. </template>
  356. <template v-else>
  357. <el-col :span="16">
  358. <el-checkbox v-model="scope.row.secondValue" true-label="true" false-label="false" style="margin:10px 0 0 15px" ></el-checkbox>
  359. </el-col>
  360. </template>
  361. <el-col :span="6" class="editBtn" v-if="scope.row.customSort > 5 && scope.row.title !== '价格' && settingValue == 2" style="margin-left:10px">
  362. <el-button type="text" @click="addCustomeLine(scope.row,scope.$index)">增加</el-button>
  363. <el-button type="text" @click="delCustomeLine(scope.$index,2)" v-if="scope.$index > 5">删除</el-button>
  364. </el-col>
  365. </el-row>
  366. </template>
  367. </el-table-column>
  368. <el-table-column label="优质" prop="thirdValue">
  369. <template slot-scope="scope" >
  370. <el-row v-if="scope.row.title == '交付时间'">
  371. <el-select v-model="scope.row.thirdValue" placeholder="请选择交付时间" style="float:left;width:100%">
  372. <el-option
  373. v-for="item in deliverTime"
  374. :key="item.value"
  375. :label="item.label"
  376. :value="item.value"></el-option>
  377. </el-select>
  378. </el-row>
  379. <el-row v-else-if="scope.row.title == '可修改次数'">
  380. <el-input v-model="scope.row.thirdValue" placeholder="请输入可修改次数" type="number"></el-input>
  381. </el-row>
  382. <el-row v-else-if="scope.row.title == '商品数量'">
  383. <el-input v-model="scope.row.thirdValue" placeholder="请输入商品数量" type="number"></el-input>
  384. </el-row>
  385. <el-row v-else-if="scope.row.title == '价格'">
  386. <el-input v-model="scope.row.thirdValue" placeholder="请输入价格" onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  387. </el-row>
  388. <el-row v-else>
  389. <template v-if="scope.row.isText > 0">
  390. <el-col :span="16">
  391. <el-input v-model="scope.row.thirdValue" placeholder="请输入服务名" v-if="scope.row.title == '服务名'"></el-input>
  392. <el-input v-model="scope.row.thirdValue" placeholder="请输入服务描述" v-else-if="scope.row.title == '服务描述'"></el-input>
  393. <el-input v-model="scope.row.thirdValue" placeholder="请输入配置参数" v-else></el-input>
  394. </el-col>
  395. </template>
  396. <template v-else>
  397. <el-col :span="16">
  398. <el-checkbox v-model="scope.row.thirdValue" true-label="true" false-label="false" style="margin:10px 0 0 15px" ></el-checkbox>
  399. </el-col>
  400. </template>
  401. <el-col :span="6" class="editBtn" v-if="scope.row.customSort > 5 && scope.row.title !== '价格' && settingValue == 3" style="margin-left:10px">
  402. <el-button type="text" @click="addCustomeLine(scope.row,scope.$index)">增加</el-button>
  403. <el-button type="text" @click="delCustomeLine(scope.$index,2)" v-if="scope.$index > 5">删除</el-button>
  404. </el-col>
  405. </el-row>
  406. </template>
  407. </el-table-column>
  408. </el-table>
  409. <div class="layer" :style="'width:' + layerWidth + 'px' " v-if="settingValue < 3">
  410. <div>
  411. <p class="p1">此处不可编辑</p>
  412. <p class="p2">请在右上角选择配置方可编辑</p>
  413. </div>
  414. </div>
  415. </div>
  416. </div>
  417. <div style="margin-top: 70px;">
  418. <div class="tableTitle">追加服务</div>
  419. <div class="expDelivery" style="width: 1280px;border:1px solid #d5d5d5">
  420. <div class="fasterDeliveryTitle" style="height:80px;padding:0 40px;display:flex;justify-content:space-between;align-items:center">
  421. <div class="fasterL"><el-checkbox v-model="showExp">特快交付</el-checkbox></div>
  422. <div class="fasterR" style=""><img src="../../assets/images/goodsAdd/灯泡.png" alt=""></div>
  423. </div>
  424. <div class="expDeliveryShow" v-if="showExp" style="padding:0 40px;background:#eeeeee">
  425. <el-row style="height:80px;line-height:80px">
  426. <el-col :span="12"><div class="grid-content bg-purple">基础</div></el-col>
  427. <el-col :span="6" style="text-align:right">
  428. <div class="grid-content bg-purple">
  429. 时间
  430. <el-select v-model="expressDeliveries[0].deliveryTime" placeholder="请选择时间">
  431. <el-option
  432. v-for="item in deliverTime"
  433. :key="item.value"
  434. :label="item.label"
  435. :value="item.value"></el-option>
  436. </el-select>
  437. </div>
  438. </el-col>
  439. <el-col :span="6" style="text-align:right">
  440. <div class="grid-content bg-purple zjje">
  441. <el-row style="display:flex; margin-top:20px">
  442. <span>额外</span>
  443. <el-row class="moneyInput">
  444. ¥<el-input style="width:160px;" placeholder="" v-model="expressDeliveries[0].price"
  445. onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  446. </el-row>
  447. </el-row>
  448. </div>
  449. </el-col>
  450. </el-row>
  451. <el-row style="height:80px;line-height:80px" v-if="settingValue > 1">
  452. <el-col :span="12"><div class="grid-content bg-purple">标准</div></el-col>
  453. <el-col :span="6" style="text-align:right">
  454. <div class="grid-content bg-purple">
  455. 时间
  456. <el-select v-model="expressDeliveries[1].deliveryTime" placeholder="请选择时间">
  457. <el-option
  458. v-for="item in deliverTime"
  459. :key="item.value"
  460. :label="item.label"
  461. :value="item.value"></el-option>
  462. </el-select>
  463. </div>
  464. </el-col>
  465. <el-col :span="6" style="text-align:right">
  466. <div class="grid-content bg-purple zjje">
  467. <el-row style="display:flex;margin-top:20px">
  468. <span>额外</span>
  469. <el-row class="moneyInput">
  470. ¥<el-input style="width:160px;" type="number" placeholder="" v-model="expressDeliveries[1].price"
  471. onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  472. </el-row>
  473. </el-row>
  474. </div>
  475. </el-col>
  476. </el-row>
  477. <el-row style="height:80px;line-height:80px" v-if="settingValue == 3">
  478. <el-col :span="12"><div class="grid-content bg-purple">优质</div></el-col>
  479. <el-col :span="6" style="text-align:right">
  480. <div class="grid-content bg-purple">
  481. 时间
  482. <el-select v-model="expressDeliveries[2].deliveryTime" placeholder="请选择时间">
  483. <el-option
  484. v-for="item in deliverTime"
  485. :key="item.value"
  486. :label="item.label"
  487. :value="item.value"></el-option>
  488. </el-select>
  489. </div>
  490. </el-col>
  491. <el-col :span="6" style="text-align:right">
  492. <div class="grid-content bg-purple zjje">
  493. <el-row style="display:flex;margin-top:20px">
  494. <span>额外</span>
  495. <el-row class="moneyInput">
  496. ¥<el-input style="width:160px;" type="number" placeholder="" v-model="expressDeliveries[2].price"
  497. onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  498. </el-row>
  499. </el-row>
  500. </div>
  501. </el-col>
  502. </el-row>
  503. </div>
  504. <div class="expDeliveryContent">
  505. <div class="expDeliveryContain">
  506. <div v-for="(item, idx) in addtoServices" :key="idx" style="border-bottom:1px solid #d5d5d5">
  507. <el-form ref="form" :model="item" label-width="80px" style="padding-bottom: 30px">
  508. <el-form-item label="标题" style="margin-top:40px">
  509. <el-input v-model="item.title" style="width:320px;margin-left:32px" maxlength="20"></el-input>
  510. <span style="margin-left:10px;">0/20最大</span>
  511. <el-button type="text" style="float:right;padding-right:20px" @click="delzjfw(idx)" v-if="idx > 0">删除</el-button>
  512. </el-form-item>
  513. <div data-v-4be286b1="" class="el-form-item expdeliDesc">
  514. <label class="el-form-item__label" style="width: 80px;">描述</label>
  515. <el-input type="textarea" style="width:620px;margin-left:32px" v-model="item.addtoDesc" maxlength="50"></el-input>
  516. <span style="margin-left:10px;">0/50最大</span>
  517. </div>
  518. <div style="display:flex;width:790px;margin-left:112px">
  519. <el-col :span="11" style="display:flex; align-items: center;">
  520. 额外费用
  521. <el-row class="moneyInput">
  522. ¥<el-input style="width:160px;" placeholder="" v-model="item.price"
  523. onkeyup="this.value=this.value.match(/\d+\.?\d{0,2}/);this.dispatchEvent(new Event('input'))"></el-input>
  524. </el-row>
  525. </el-col>
  526. <el-col :span="11">
  527. 额外时间
  528. <!-- <el-input style="width:190px;"
  529. placeholder=""
  530. v-model="item.deliveryTime"
  531. oninput="if(value>99999)value=99999;if(value.length>5)value=value.slice(0,5);if(value<1 && value)value=1"
  532. >
  533. </el-input> -->
  534. <el-select v-model="item.deliveryTime" placeholder="请选择额外时间">
  535. <el-option
  536. v-for="item in deliverTime"
  537. :key="item.value"
  538. :label="item.label"
  539. :value="item.value"></el-option>
  540. </el-select>
  541. </el-col>
  542. </div>
  543. </el-form>
  544. </div>
  545. </div>
  546. </div>
  547. <div class="additionalServive" style="padding:0 40px;height:80px;line-height: 80px;font-size:18px;">
  548. <i class="el-icon-circle-plus" style="font-size:1em;font-weight:bold"><span style="margin-left:20px" @click="addserviceBtn">添加追加服务</span> </i>
  549. </div>
  550. </div>
  551. </div>
  552. </div>
  553. <div class="nextStepBtn" style="display:flex">
  554. <el-button style="margin-top: 20px;" @click="activeIndex = '0'">上一步</el-button>
  555. <el-button style="margin-top: 20px;color:#fff;background:#81d8d0" @click="nextStepSecong">下一步</el-button>
  556. </div>
  557. </el-tab-pane>
  558. <el-tab-pane label="" name="2">
  559. <div class="multiFlex dispalyFlex" style="margin-top: 30px;" >
  560. <div class="addTitle">常见问题解答</div>
  561. </div>
  562. <div class="stepsContent1">
  563. <div style="margin-top: 20px;" >
  564. <div class="alreadyAdded" v-if="faq.length >0">
  565. <div class="tableTitle">添加的问题和答案</div>
  566. <div class="list" v-for="(item,idx) in faq" :key="item.question+ '-only'">
  567. <div class="item">
  568. <div class="left">{{item.question}}</div>
  569. <div class="right">
  570. <span @click="delFaq(idx)">删除</span>
  571. <span @click="item.show = !item.show">查看详情 ></span>
  572. </div>
  573. </div>
  574. <div class="item-con" v-show="item.show">{{item.answer}}</div>
  575. </div>
  576. </div>
  577. <div class="tableTitle">
  578. <span>为您的卖家添加问题和答案</span>
  579. <i class="el-icon-circle-plus" style="font-size:1em;font-weight:bold; float:right" v-if="faq.length > 0 && !showAnsForm"><span style="margin-left:5px" @click="showAnswer">添加常见问题</span> </i>
  580. </div>
  581. <div v-if="showAnsForm">
  582. <el-input v-model="questionText" maxlength="30" placeholder="添加一个问题。例如:你能翻译成英文吗" style=""></el-input>
  583. <el-input type="textarea" v-model="answerText" maxlength="300" placeholder="添加一个答案。例如:我能将英文翻译成中文。" style="margin-top:20px"></el-input>
  584. <div class="" style="margin:20px auto;width:300px">
  585. <button @click="cancelQ" type="button" class="el-button el-button--default" style="">
  586. <span>取消</span>
  587. </button>
  588. <button @click="addFaq" type="button" class="el-button el-button--default" style="margin-left: 20px; background: rgb(129, 216, 208);color:#fff">
  589. <span>添加</span>
  590. </button>
  591. </div>
  592. </div>
  593. </div>
  594. <div style="margin-top: 70px;">
  595. <div class="addTitle">向买家提出要求</div>
  596. <div class="" style="color: #666666;margin:28px 0">添加问题以帮助买家为您提供开始处理他们的订单所需的确切信息</div>
  597. <el-tag
  598. v-for="tag in askfors"
  599. :key="tag.id+ '-only11'"
  600. closable
  601. @close="closeTag(tag)">
  602. {{tag.content}}
  603. </el-tag>
  604. <el-button style="background: rgb(129, 216, 208);color:#fff" @click="dialogVisible = true">添加要求</el-button>
  605. <el-dialog
  606. title="添加要求"
  607. :visible.sync="dialogVisible"
  608. width="30%"
  609. :before-close="handleClose">
  610. <div style="">
  611. <el-input type="textarea" v-model="askfors_text" placeholder="索取必要的详细信息,例如尺寸、品牌准则等。" :rows="6"></el-input>
  612. </div>
  613. <span slot="footer" class="dialog-footer">
  614. <el-button @click="dialogVisible = false">取消</el-button>
  615. <el-button type="primary" @click="addAsk" style="background: rgb(129, 216, 208);color:#fff">添加</el-button>
  616. </span>
  617. </el-dialog>
  618. </div>
  619. </div>
  620. <div class="nextStepBtn" style="width:300px;margin:30px auto">
  621. <el-button style="" @click="activeIndex = '1'">上一步</el-button>
  622. <el-button style="margin-left:20px;background: rgb(129, 216, 208);color:#fff" @click="submitAdd">提交</el-button>
  623. </div>
  624. </el-tab-pane>
  625. <el-tab-pane label="" name="3">
  626. <div class="merchantRegist" style="text-align:center">
  627. <div class="merchantRegistration">
  628. <div class="img">
  629. <img src="../../assets/images/goodsAdd/组 13@2x.png" alt="">
  630. </div>
  631. <div class="submitTitle">提交成功</div>
  632. <div class="showDetail">商品提交成功,请前往管理商品列表进行商品的上架吧</div>
  633. <div class="autoJump">若10秒后没有自动跳转,请点击<a href="">www.baidu.com</a></div>
  634. </div>
  635. </div>
  636. </el-tab-pane>
  637. </el-tabs>
  638. </div>
  639. </div>
  640. <!-- footer部分开始 -->
  641. <Footer></Footer>
  642. </div>
  643. </template>
  644. <script>
  645. // import UserHttp from '@/model/UserHttp'
  646. import GoodsHttp from '@/model/GoodsHttp';
  647. // import Editor from "@/components/Editor";
  648. // import EditorBar from "../../components/Editor";
  649. // import Holstein from '@/components/Nav/Holstein.vue'
  650. import Uploadpics from '@/components/productAddImgs/Uploadimgs.vue';
  651. import UploadAudio from '@/components/productAddAudio/uploadAudio.vue';
  652. import Holstein from '../../components/Nav/Holstein.vue';
  653. import Footer from '@/components/Footer/footer.vue';
  654. import UserHttp from '../../model/UserHttp';
  655. import {
  656. Quill,
  657. quillEditor
  658. } from 'vue-quill-editor'
  659. import 'quill/dist/quill.core.css'
  660. import 'quill/dist/quill.snow.css'
  661. import 'quill/dist/quill.bubble.css'
  662. //引入font.css
  663. import '@/assets/css/font.css'
  664. // 自定义字体大小
  665. let Size = Quill.import('attributors/style/size')
  666. Size.whitelist = ['10px', '12px', '14px', '16px', '18px', '20px']
  667. Quill.register(Size, true)
  668. // 自定义字体类型
  669. var fonts = ['SimSun', 'SimHei', 'Microsoft-YaHei', 'KaiTi', 'FangSong', 'Arial', 'Times-New-Roman', 'sans-serif',
  670. '宋体', '黑体'
  671. ]
  672. var Font = Quill.import('formats/font')
  673. Font.whitelist = fonts
  674. Quill.register(Font, true)
  675. export default {
  676. components: {
  677. // EditorBar,
  678. Holstein,
  679. Footer,
  680. Uploadpics,
  681. UploadAudio,
  682. quillEditor
  683. },
  684. data() {
  685. var validatesfz = (rule, value, callback) => {
  686. if (value === '') {
  687. callback(new Error('请完成必填项'));
  688. } else {
  689. callback();
  690. }
  691. };
  692. var validateimg = (rule, value, callback) => {
  693. if (value === '') {
  694. callback(new Error('请上传商品图片,默认第一张为封面图'));
  695. } else {
  696. callback();
  697. }
  698. };
  699. return {
  700. userId:'',
  701. domain: 'http://yshopapi.inroyltd.com',
  702. NavTitle: [],
  703. dialogContImgVisible: false,
  704. dialogContImgUrl: '',
  705. addform: {
  706. categoryId: '', //商品类目
  707. serviceName: '', //商品名称
  708. serviceSort: '', //商品排序
  709. orderQuantity: '', //可接单量
  710. filesTwo: [],
  711. Video:"",
  712. imgs: [],
  713. imgs2: [],
  714. serviceDesc: '',
  715. videoUrl: []
  716. },
  717. videoFlag: false,
  718. videoUploadPercent: 0,
  719. //文本编辑器
  720. editorOption: {
  721. placeholder: "请输入"
  722. // theme: "snow", // or 'bubble'
  723. // modules: {
  724. // toolbar: {
  725. // container: '#toolbar'
  726. // }
  727. // }
  728. },
  729. //新增商品 上传视频
  730. /* 表单验证规则 */
  731. rulesadd: {
  732. categoryId: [
  733. {
  734. required: true,
  735. message: '请选择商品类目',
  736. validator: validatesfz,
  737. trigger: 'blur'
  738. }
  739. ],
  740. serviceName: [
  741. {
  742. required: true,
  743. message: '请选择商品名称',
  744. validator: validatesfz,
  745. trigger: 'blur'
  746. }
  747. ],
  748. serviceSort: [{ required: true, message: '请选择商品排序', trigger: 'blur' }],
  749. serviceStock: [{ required: true, message: '请选择可接单量', trigger: 'blur' }],
  750. filesTwo: [{ required: false, message: '请完成上传', trigger: 'blur' }],
  751. video: [{ required: false, message: '请完成上传', trigger: 'blur' }],
  752. img: [
  753. {
  754. required: true,
  755. message: '请上传商品图片,默认第一张为封面图',
  756. validator: validateimg,
  757. trigger: 'blur'
  758. }
  759. ]
  760. },
  761. // editor:null,
  762. activeIndex: '0',
  763. // 售卖信息填写
  764. deliveryTimeOptions:[
  765. {
  766. value: '24小时内交付',
  767. label: '24小时内交付'
  768. },
  769. {
  770. value: '3天内交付',
  771. label: '3天内交付'
  772. },
  773. {
  774. value: '5天内交付',
  775. label: '5天内交付'
  776. },
  777. {
  778. value: '随意。',
  779. label: '随意。'
  780. }
  781. ],
  782. showExp:true,
  783. pricesCustoms: [],
  784. pricesCustoms1: [],
  785. pricesCustoms2: [],
  786. pricesCustoms3: [],
  787. addtoServices: [
  788. {
  789. deliveryTime: '',
  790. title: '',
  791. desc: '',
  792. price: ''
  793. }
  794. ],
  795. expressDeliveries: [
  796. {
  797. deliveryTime: '',
  798. level: 1,
  799. price: ''
  800. },
  801. {
  802. deliveryTime: '',
  803. level: 2,
  804. price: ''
  805. },
  806. {
  807. deliveryTime: '',
  808. level: 3,
  809. price: ''
  810. }
  811. ],
  812. faq: [],
  813. questionText: '',
  814. answerText: '',
  815. dialogVisible: false,
  816. askfors: [],
  817. askfors_text: '',
  818. setting:[
  819. {
  820. value: 1,
  821. label: "基础"
  822. },
  823. {
  824. value: 2,
  825. label: "基础,标准"
  826. },
  827. {
  828. value: 3,
  829. label: "基础,标准,优质"
  830. }
  831. ],
  832. settingValue: 0,
  833. deliverTime: [
  834. {
  835. value: '1',
  836. label: '1天'
  837. },
  838. {
  839. value: '2',
  840. label: '2天'
  841. },
  842. {
  843. value: '3',
  844. label: '3天'
  845. },
  846. {
  847. value: '4',
  848. label: '4天'
  849. },
  850. {
  851. value: '5',
  852. label: '5天'
  853. },
  854. {
  855. value: '6',
  856. label: '6天'
  857. },
  858. {
  859. value: '7',
  860. label: '7天'
  861. },
  862. {
  863. value: '10',
  864. label: '10天'
  865. },
  866. {
  867. value: '14',
  868. label: '14天'
  869. },{
  870. value: '21',
  871. label: '21天'
  872. },{
  873. value: '30',
  874. label: '30天'
  875. },{
  876. value: '60',
  877. label: '60天'
  878. },{
  879. value: '90',
  880. label: '90天'
  881. }
  882. ],
  883. tableWidth: 640,
  884. showAnsForm: true,
  885. id:'', // 商品ID
  886. layerWidth: 0,
  887. pageTitle: '新增商品'
  888. };
  889. },
  890. watch: {
  891. content() {
  892. this.editor.txt.html(this.content);
  893. },
  894. settingValue: {
  895. handler(newVal, oldVal) {
  896. if (newVal == 1) {
  897. this.layerWidth = 640
  898. if (this.expressDeliveries[0].deliveryTime) {
  899. this.expressDeliveries = [
  900. {
  901. deliveryTime: this.expressDeliveries[0].deliveryTime,
  902. level: 1,
  903. price: this.expressDeliveries[0].price
  904. }
  905. ]
  906. } else {
  907. this.expressDeliveries = [
  908. {
  909. deliveryTime: '',
  910. level: 1,
  911. price: ''
  912. }
  913. ]
  914. }
  915. } else if (newVal == 2){
  916. this.layerWidth = 320
  917. if (this.expressDeliveries[0].deliveryTime && this.expressDeliveries[1] && this.expressDeliveries[1].deliveryTime) {
  918. this.expressDeliveries = [
  919. {
  920. deliveryTime: this.expressDeliveries[0].deliveryTime,
  921. level: 1,
  922. price: this.expressDeliveries[0].price
  923. },
  924. {
  925. deliveryTime: this.expressDeliveries[1].deliveryTime,
  926. level: 2,
  927. price: this.expressDeliveries[1].price
  928. }
  929. ]
  930. } else {
  931. this.expressDeliveries = [
  932. {
  933. deliveryTime: '',
  934. level: 1,
  935. price: ''
  936. },
  937. {
  938. deliveryTime: '',
  939. level: 2,
  940. price: ''
  941. }
  942. ]
  943. }
  944. } else {
  945. this.layerWidth = 0
  946. this.expressDeliveries = [
  947. {
  948. deliveryTime: '',
  949. level: 1,
  950. price: ''
  951. },
  952. {
  953. deliveryTime: '',
  954. level: 2,
  955. price: ''
  956. },
  957. {
  958. deliveryTime: '',
  959. level: 3,
  960. price: ''
  961. }
  962. ]
  963. }
  964. },
  965. deep: true
  966. },
  967. },
  968. async mounted() {
  969. // this.mountServiceCate()
  970. var res = await GoodsHttp.serviceProCategory();
  971. this.NavTitle = res.data.biz.content;
  972. this.init()
  973. if(this.$cookie){
  974. this.userId = JSON.parse(this.$cookie.get('loginInfo')).id
  975. }
  976. // 编辑商品时带参数id,新增不带
  977. if (this.$route.query.id) {
  978. this.id = this.$route.query.id;
  979. this.getDetail();
  980. this.pageTitle = '编辑商品'
  981. }
  982. },
  983. methods: {
  984. init() {
  985. this.settingValue = 3;
  986. let titleArr = ['服务名','服务描述','交付时间','可修改次数','商品数量','价格']
  987. let newArr = [];
  988. for (const i in titleArr) {
  989. let obj = {
  990. title: titleArr[i],
  991. isText: 1,
  992. oneValue: '',
  993. secondValue: '',
  994. thirdValue: '',
  995. customSort: parseInt(i) + 1
  996. }
  997. newArr.push(obj)
  998. }
  999. let obj2 = {
  1000. title: '',
  1001. isText: 1,
  1002. oneValue: '',
  1003. secondValue: '',
  1004. thirdValue: '',
  1005. customSort: 6
  1006. }
  1007. newArr.splice(5, 0,obj2)
  1008. newArr.forEach((item,index) => {
  1009. if (item.title == '价格') {
  1010. item.customSort = parseInt(index) + 1
  1011. }
  1012. })
  1013. this.pricesCustoms = newArr
  1014. },
  1015. getDetail() {
  1016. this.$http.get('/api/serviceProduct/' + this.id).then(res => {
  1017. // this.addform = res.data.biz;
  1018. this.addform.serviceName = res.data.biz.serviceName
  1019. this.addform.serviceSort = res.data.biz.serviceSort
  1020. this.addform.orderQuantity = res.data.biz.orderQuantity
  1021. this.addform.categoryId = res.data.biz.categoryId
  1022. this.addform.serviceDesc = res.data.biz.serviceDesc
  1023. if (res.data.biz.files.length > 0) {
  1024. this.addform.imgs = [];
  1025. // 视频图片处理
  1026. let imgArr = []
  1027. let imgArr2 = []
  1028. res.data.biz.files.forEach(item => {
  1029. if (item.fileType == 3) {
  1030. this.addform.Video = item.fileUrl
  1031. this.addform.videoUrl.push(item)
  1032. } else {
  1033. // let obj = {
  1034. // name: '',
  1035. // url:item.fileUrl,
  1036. // fileType: item.fileType,
  1037. // }
  1038. let obj2 = {
  1039. name: '',
  1040. url: 'http://yshopapi.inroyltd.com' + item.fileUrl,
  1041. }
  1042. imgArr.push(item)
  1043. imgArr2.push(obj2)
  1044. }
  1045. })
  1046. this.addform.imgs2 = imgArr2
  1047. this.addform.imgs = imgArr
  1048. } else {
  1049. this.addform.Video = ""
  1050. this.addform.videoUrl = []
  1051. this.addform.imgs = []
  1052. }
  1053. this.settingValue = res.data.biz.pricesCustomsCount;
  1054. if (res.data.biz.expressDeliveries.length > 0) {
  1055. this.expressDeliveries = res.data.biz.expressDeliveries;
  1056. } else {
  1057. this.showExp = false
  1058. }
  1059. if (res.data.biz.addtoServices.length > 0) {
  1060. this.addtoServices = res.data.biz.addtoServices;
  1061. }
  1062. this.faq = res.data.biz.faq;
  1063. if (res.data.biz.wnAskfors) {
  1064. this.askfors = res.data.biz.wnAskfors
  1065. }
  1066. //配置参数
  1067. this.pricesCustoms = res.data.biz.pricesCustoms;
  1068. if (res.data.biz.pricesCustoms.length == 6) { //当编辑时没有选择其他配置参数时,像数组里追加一个空数据
  1069. let obj = {
  1070. title: '',
  1071. isText: 1,
  1072. oneValue: '',
  1073. secondValue: '',
  1074. thirdValue: '',
  1075. customSort: 6
  1076. }
  1077. this.pricesCustoms.splice(5, 0,obj)
  1078. }
  1079. // 常见问题
  1080. let faqArr = res.data.biz.faq
  1081. faqArr.forEach(item => {
  1082. item.show = false
  1083. })
  1084. this.faq = JSON.parse(JSON.stringify(faqArr))
  1085. })
  1086. },
  1087. async submitaddbasic(formName) {
  1088. this.$refs[formName].validate((valid) => {
  1089. if (valid) {
  1090. console.log(this.addform)
  1091. if (this.addform.imgs.length == 0) {
  1092. this.$message.error('请上传商品图片')
  1093. return
  1094. }
  1095. if (!this.addform.serviceDesc) {
  1096. this.$message.error('请填写商品描述')
  1097. return
  1098. }
  1099. this.activeIndex = '1';
  1100. } else {
  1101. this.$message.error('请完成新增商品基本信息填写');
  1102. return false;
  1103. }
  1104. });
  1105. },
  1106. handleChange(cateId) {
  1107. this.addform.categoryId = cateId[cateId.length - 1];
  1108. },
  1109. //上传图片
  1110. //【内容图删除事件】
  1111. handleContImgRemove: function (file, fileList) {
  1112. console.log(file.url)
  1113. let link = file.url.replace('http://yshopapi.inroyltd.com', '')
  1114. this.addform.imgs.forEach((item,idx) => {
  1115. if (item.fileUrl == link) {
  1116. this.addform.imgs.splice(idx, 1)
  1117. }
  1118. })
  1119. console.log(this.addform.imgs)
  1120. // this.addform.imgs.splice(0, this.addform.imgs.length, ...fileList);
  1121. },
  1122. handleAvatarSuccess(res) {
  1123. this.addform.imgs.push({
  1124. fileType:1,
  1125. fileUrl: res[0].fileUrl,
  1126. createTime: '',
  1127. fileId: ''
  1128. });
  1129. },
  1130. beforeUploadVideo(file) {
  1131. console.log(file)
  1132. const isLt10M = file.size / 1024 / 1024 < 10;
  1133. if (['video/am', 'video/mov','video/mvb','video/rm','video/flv','video/mp4'].indexOf(file.type) == -1) {
  1134. this.$message.error('请上传正确的视频格式');
  1135. return false;
  1136. }
  1137. if (!isLt10M) {
  1138. this.$message.error('上传视频大小不能超过200MB哦!');
  1139. return false;
  1140. }
  1141. },
  1142. handleContvideoRemove: function (file, fileList) {
  1143. console.log(file.url)
  1144. let link = file.url.replace('http://yshopapi.inroyltd.com/api/uploadVideo', '')
  1145. this.addform.videoUrl.forEach((item,idx) => {
  1146. if (item.fileUrl == link) {
  1147. this.addform.videoUrl.splice(idx, 1)
  1148. }
  1149. })
  1150. console.log(this.addform.videoUrl)
  1151. // this.addform.imgs.splice(0, this.addform.imgs.length, ...fileList);
  1152. },
  1153. beforeUploadImage(file) {
  1154. if (['image/png', 'image/jpg','image/jpeg'].indexOf(file.type) == -1) {
  1155. this.$message.error('请上传正确的图片格式');
  1156. return false;
  1157. }
  1158. },
  1159. uploadImage(params) {
  1160. let form = new FormData();
  1161. form.append('image', params.file);
  1162. this.$http.post('http://yshopapi.inroyltd.com/api/uploadImage',form).then(res => {
  1163. this.addform.imgs.push({
  1164. fileId: '',
  1165. fileType:1,
  1166. fileUrl: res.data[0].fileUrl,
  1167. createTime: ''
  1168. });
  1169. });
  1170. },
  1171. //内容图数量限制3张
  1172. exceedTips: function () {
  1173. this.$message.error('最多只能上传19张图片');
  1174. },
  1175. //【内容图片预览事件】
  1176. handleContImgPreview: function (file) {
  1177. this.dialogContImgUrl = file.url;
  1178. this.dialogContImgVisible = true;
  1179. },
  1180. // 点击添加追加服务
  1181. addserviceBtn() {
  1182. let obj = {
  1183. title: '',
  1184. addtoDesc: '',
  1185. price: '',
  1186. deliveryTime: ''
  1187. };
  1188. this.addtoServices.push(obj)
  1189. },
  1190. handleClose(done) {
  1191. this.$confirm('确认关闭?')
  1192. .then(function() {
  1193. done();
  1194. })
  1195. .catch(function() {});
  1196. },
  1197. // 提交信息
  1198. submitAdd() {
  1199. let dt = {
  1200. addtoServices: this.addtoServices,
  1201. askfors: this.askfors,
  1202. categoryId: this.addform.categoryId,
  1203. createUser: this.userId,
  1204. faq: this.faq,
  1205. files: this.addform.videoUrl.concat(this.addform.imgs),
  1206. serviceName: this.addform.serviceName,
  1207. serviceSort: this.addform.serviceSort,
  1208. serviceDesc: this.addform.serviceDesc,
  1209. orderQuantity: this.addform.orderQuantity
  1210. // pricesCustoms: this.pricesCustoms
  1211. }
  1212. if (!this.addtoServices[0].price) {
  1213. dt.addtoServices = [];
  1214. }
  1215. // 特快交付
  1216. if (this.showExp) {
  1217. dt.expressDeliveries = this.expressDeliveries
  1218. }
  1219. // 配置参数
  1220. let arr = this.pricesCustoms;
  1221. console.log(this.settingValue)
  1222. if (this.settingValue == 1) {
  1223. arr.forEach(item => {
  1224. item.secondValue = ''
  1225. item.thirdValue = ''
  1226. })
  1227. }
  1228. if (this.settingValue == 2) {
  1229. arr.forEach(item => {
  1230. item.thirdValue = ''
  1231. })
  1232. }
  1233. arr.forEach((item,index) => {
  1234. if (item.title == '') {
  1235. arr.splice(index, 1)
  1236. }
  1237. })
  1238. dt.pricesCustoms = arr
  1239. let url = '/api/serviceProduct/add'
  1240. if (this.id) { // 编辑商品
  1241. url = '/api/serviceProduct/update';
  1242. dt.uid = this.id
  1243. }
  1244. this.$http.post(url, dt).then(() => {
  1245. if (this.id) { // 编辑商品
  1246. this.$message.success('商品修改成功');
  1247. } else {
  1248. this.$message.success('商品添加成功');
  1249. }
  1250. this.activeIndex = "3"
  1251. })
  1252. },
  1253. addAsk() {
  1254. if (!this.askfors_text) {
  1255. this.$message.error('请输入要求')
  1256. return
  1257. }
  1258. let obj = {
  1259. id: '',
  1260. content: this.askfors_text
  1261. }
  1262. this.askfors.push(obj);
  1263. console.log(this.askfors)
  1264. this.dialogVisible = false;
  1265. this.askfors_text = ''
  1266. },
  1267. addCustomeLine(val,index) {
  1268. if (this.settingValue == 1) {
  1269. if (val.isText && !val.oneValue || !val.title) {
  1270. this.$message.error('请填写信息')
  1271. return
  1272. }
  1273. } else if (this.settingValue == 2){
  1274. if (val.isText && (!val.oneValue || !val.secondValue) || !val.title) {
  1275. this.$message.error('请填写信息')
  1276. return
  1277. }
  1278. } else {
  1279. if (val.isText && (!val.oneValue || !val.secondValue || !val.thirdValue) || !val.title) {
  1280. this.$message.error('请填写信息')
  1281. return
  1282. }
  1283. }
  1284. let obj = {
  1285. title: '',
  1286. isText: 1,
  1287. oneValue: '',
  1288. secondValue: '',
  1289. thirdValue: '',
  1290. customSort: index + 1
  1291. }
  1292. this.pricesCustoms.splice(index + 1, 0, obj)
  1293. },
  1294. delCustomeLine(index, type) {
  1295. this.pricesCustoms.splice(index, 1)
  1296. },
  1297. delzjfw(idx) {
  1298. this.addtoServices.splice(idx, 1)
  1299. },
  1300. addFaq() {
  1301. if (this.questionText && this.answerText) {
  1302. let obj = {
  1303. question: this.questionText,
  1304. answer: this.answerText,
  1305. show: false
  1306. }
  1307. this.faq.push(obj)
  1308. this.questionText = "";
  1309. this.answerText = "";
  1310. this.showAnsForm = false
  1311. } else {
  1312. this.$message.error('请输入问题和答案')
  1313. }
  1314. },
  1315. delFaq(idx) {
  1316. this.faq.splice(idx, 1);
  1317. if (this.faq.length == 0) {
  1318. this.showAnsForm = true
  1319. }
  1320. },
  1321. cancelQ() {
  1322. this.questionText = '';
  1323. this.answerText = ''
  1324. },
  1325. closeTag(tag) {
  1326. this.askfors.splice(this.askfors.indexOf(tag), 1);
  1327. },
  1328. changeText(e,idx) {
  1329. console.log(e)
  1330. console.log(idx)
  1331. let arr = this.pricesCustoms[idx];
  1332. arr.isText = e.isText
  1333. },
  1334. nextStepSecong() {
  1335. if (this.settingValue == 1) {
  1336. let arr = this.pricesCustoms;
  1337. for (const i in arr) {
  1338. if (arr[i].isText && arr[i].title && !arr[i].oneValue) {
  1339. this.$message.error('请填写' +arr[i].title)
  1340. return false
  1341. }
  1342. }
  1343. if (this.showExp) {
  1344. if (!this.expressDeliveries[0].deliveryTime || !this.expressDeliveries[0].price) {
  1345. this.$message.error('请填写特快交付信息')
  1346. return false
  1347. }
  1348. }
  1349. } else if (this.settingValue == 2) {
  1350. let arr = this.pricesCustoms;
  1351. for (const i in arr) {
  1352. if (arr[i].isText && arr[i].title && !arr[i].oneValue) {
  1353. this.$message.error('请填写' +arr[i].title)
  1354. return false
  1355. }
  1356. }
  1357. for (const i in arr) {
  1358. if (arr[i].isText && arr[i].title && !arr[i].secondValue) {
  1359. this.$message.error('请填写' +arr[i].title)
  1360. return false
  1361. }
  1362. }
  1363. if (this.showExp) {
  1364. for (const i in this.expressDeliveries) {
  1365. let arr = this.expressDeliveries
  1366. if (!arr[i].deliveryTime || !arr[i].price) {
  1367. this.$message.error('请填写特快交付信息')
  1368. return false
  1369. }
  1370. }
  1371. }
  1372. } else {
  1373. let arr = this.pricesCustoms;
  1374. for (const i in arr) {
  1375. if (arr[i].isText && arr[i].title && !arr[i].oneValue) {
  1376. this.$message.error('请填写' +arr[i].title)
  1377. return false
  1378. }
  1379. if (arr[i].isText && arr[i].title && !arr[i].secondValue) {
  1380. this.$message.error('请填写' +arr[i].title)
  1381. return false
  1382. }
  1383. if (arr[i].isText && arr[i].title && !arr[i].thirdValue) {
  1384. this.$message.error('请填写' +arr[i].title)
  1385. return false
  1386. }
  1387. }
  1388. if (this.showExp) {
  1389. for (const i in this.expressDeliveries) {
  1390. let arr = this.expressDeliveries
  1391. if (!arr[i].deliveryTime || !arr[i].price) {
  1392. this.$message.error('请填写特快交付信息')
  1393. return false
  1394. }
  1395. }
  1396. }
  1397. }
  1398. this.activeIndex = '2'
  1399. },
  1400. checkNum(e) {
  1401. if (e < 1) {
  1402. this.addform.serviceStock = 1;
  1403. } else if (e > 99999) {
  1404. this.addform.serviceStock = 99999;
  1405. }
  1406. },
  1407. uploadVideoProcess(event, file, fileList){
  1408. this.videoFlag = true;
  1409. this.videoUploadPercent = file.percentage;
  1410. },
  1411. handleVideoSuccess(res, file) { //获取上传图片地址
  1412. this.videoFlag = false;
  1413. this.videoUploadPercent = 0;
  1414. if(res){
  1415. this.addform.videoUrl = [];
  1416. this.addform.Video = res[0].fileUrl;
  1417. this.addform.videoUrl.push({
  1418. fileType: 3,
  1419. fileUrl:res[0].fileUrl,
  1420. fileId:'',
  1421. createTime:'' });
  1422. }else{
  1423. this.$message.error('视频上传失败,请重新上传!');
  1424. }
  1425. },
  1426. showAnswer () {
  1427. if (this.faq.length == 10) {
  1428. this.$message.warning('最多添加十个问题哦~');
  1429. return false
  1430. }
  1431. this.showAnsForm = true;
  1432. }
  1433. }
  1434. };
  1435. </script>
  1436. <style >
  1437. /* 隐藏el-tals标签头部 */
  1438. .merchantRegistration .el-tabs__header {
  1439. display: none !important;
  1440. }
  1441. .merchantRegistration .el-steps {
  1442. margin-top: 20px;
  1443. }
  1444. .moneyInput {
  1445. width: 200px;
  1446. border: 1px solid #DCDFE6;
  1447. border-radius: 4px;
  1448. display: flex;
  1449. align-items: center;
  1450. padding-left: 5px;
  1451. margin-left: 5px;
  1452. }
  1453. .moneyInput .el-input__inner {
  1454. border: none;
  1455. }
  1456. .zjje {
  1457. height: 40px;
  1458. line-height: 40px;
  1459. float: right;
  1460. }
  1461. .zjje .moneyInput {
  1462. width: 220px;
  1463. background-color: #fff;
  1464. }
  1465. .zjje .moneyInput .el-input__inner {
  1466. width: 200px;
  1467. }
  1468. .upload-demo {
  1469. width: 360px;
  1470. }
  1471. input::-webkit-outer-spin-button,
  1472. input::-webkit-inner-spin-button {
  1473. -webkit-appearance: none;
  1474. }
  1475. input[type="number"]{
  1476. -moz-appearance: textfield;
  1477. }
  1478. .stepsContent1 .el-select .el-input__inner {
  1479. text-align: left;
  1480. }
  1481. /* .el-select-dropdown__item {
  1482. text-align: center;
  1483. } */
  1484. </style>
  1485. <style scoped>
  1486. .home {
  1487. width: 100%;
  1488. }
  1489. .center {
  1490. margin: 0 320px;
  1491. }
  1492. /* */
  1493. .addTitle {
  1494. height: 29px;
  1495. font-size: 30px;
  1496. font-family: Source Han Sans CN;
  1497. font-weight: bold;
  1498. color: #000000;
  1499. line-height: 24px;
  1500. }
  1501. .merchantRegist {
  1502. width: 100%;
  1503. }
  1504. .merchantRegistration {
  1505. width: 1280px;
  1506. margin: 50px auto;
  1507. }
  1508. .stepsContent {
  1509. margin: 20px 0;
  1510. }
  1511. .el-step__head.is-process {
  1512. color: #303133 !important;
  1513. border-color: #303133 !important;
  1514. }
  1515. .el-step__head.is-success,
  1516. .el-step__title.is-success {
  1517. color: #81d8d0 !important;
  1518. border-color: #81d8d0 !important;
  1519. }
  1520. .el-card__body > div {
  1521. margin: 10px 0;
  1522. }
  1523. /* */
  1524. .boldLabel {
  1525. color: #000000;
  1526. font-size: 18px;
  1527. font-weight: bold;
  1528. }
  1529. /* */
  1530. .upload-demo /deep/ ul,
  1531. .upload-demo /deep/ .el-upload-list {
  1532. display: flex !important;
  1533. justify-content: space-between !important;
  1534. align-items: center !important;
  1535. }
  1536. .upload-demo /deep/ .el-upload-list__item {
  1537. width: 120px !important;
  1538. }
  1539. .el-upload-list--picture /deep/ .el-upload-list__item {
  1540. width: 120px !important;
  1541. }
  1542. /* */
  1543. .tableTitle{
  1544. font-size: 18px;
  1545. color: #000000;
  1546. font-weight: bold;
  1547. margin: 41px 0 18px 0;
  1548. }
  1549. table{
  1550. border-collapse:collapse;
  1551. border: 1px solid #d8d8d8;
  1552. }
  1553. .el-table__header td,th{
  1554. border: 1px solid #d8d8d8;
  1555. }
  1556. tbody tr {
  1557. height:70px;
  1558. line-height: 70px;
  1559. /* text-align: center; */
  1560. }
  1561. tbody tr >>>.el-textarea__inner{
  1562. height: 160px;
  1563. }
  1564. tbody tr >>>.el-textarea__inner,
  1565. tbody tr >>>.el-input__inner{
  1566. border: none;
  1567. }
  1568. .slide-fade-enter-active {
  1569. transition: all .8s ease;
  1570. }
  1571. .slide-fade-leave-active {
  1572. transition: all .8s cubic-bezier(1.0, 0.5, 0.8, 1.0);
  1573. }
  1574. .slide-fade-enter, .slide-fade-leave-to
  1575. /* .slide-fade-leave-active for below version 2.1.8 */ {
  1576. transform: translateX(10px);
  1577. opacity: 0;
  1578. }
  1579. /* */
  1580. .expdeliDesc .expDesctextarea .el-textarea__inner{
  1581. height:140px !important;
  1582. }
  1583. .el-tag {
  1584. margin-right: 10px;
  1585. }
  1586. .alreadyAdded .list {
  1587. border-bottom: 1px solid #dddddd;
  1588. }
  1589. .alreadyAdded .list .item{
  1590. line-height: 30px;
  1591. padding: 10px 0;
  1592. display: flex;
  1593. justify-content: space-between;
  1594. }
  1595. .alreadyAdded .list .item-con {
  1596. padding: 10px 0;
  1597. }
  1598. .alreadyAdded .list .item span {
  1599. margin-left: 20px;
  1600. }
  1601. .alreadyAdded .list .item span:hover {
  1602. color: rgb(129, 216, 208);
  1603. }
  1604. </style>
  1605. <style lang="scss">
  1606. .tableCon {
  1607. display: flex;
  1608. .leftTitle {
  1609. width: 320px;
  1610. .item {
  1611. width: 100%;
  1612. height: 60px;
  1613. line-height: 60px;
  1614. border-bottom: 1px solid #d8d8d8;
  1615. input {
  1616. border: none;
  1617. background-color: rgb(238, 238, 238);
  1618. width: 140px;
  1619. padding-left: 0;
  1620. }
  1621. }
  1622. }
  1623. .valueBox {
  1624. width: 320px;
  1625. .item {
  1626. position: relative;
  1627. width: 100%;
  1628. height: 60px;
  1629. line-height: 60px;
  1630. border-bottom: 1px solid #d8d8d8;
  1631. border-right: 1px solid #d8d8d8;
  1632. background-color: #fff;
  1633. input {
  1634. border: none;
  1635. }
  1636. }
  1637. .editBtn {
  1638. position: absolute;
  1639. right: 10px;
  1640. top: 0;
  1641. }
  1642. }
  1643. }
  1644. .tableInfro {
  1645. position: relative;
  1646. .layer {
  1647. position: absolute;
  1648. right: 0;
  1649. top: 0;
  1650. width: 0;
  1651. height: 100%;
  1652. background-color: rgba(238, 238, 238,0.8);
  1653. z-index: 10;
  1654. display: flex;
  1655. align-items: center;
  1656. justify-content: center;
  1657. text-align: center;
  1658. .p1 {
  1659. font-size: 34px;
  1660. }
  1661. .p2 {
  1662. font-size: 14px;
  1663. color: red;
  1664. }
  1665. }
  1666. .el-input__inner {
  1667. border: none;
  1668. }
  1669. }
  1670. .videoBox {
  1671. width: 360px;
  1672. height: 180px;
  1673. }
  1674. </style>