form.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  1. <template name="secondHandrelease">
  2. <view class="fleaMarketForm">
  3. <view class="bannerimg"><image src="https://static.caimei365.com/app/img/bg/secondbg.jpg"></image></view>
  4. <view class="my-maintenance" :style="{ paddingBottom: isIphoneX ? '270rpx' : '168rpx' }">
  5. <view class="newsTitle">
  6. <view class="nestext">
  7. 欢迎您来到采美365网二手商品市场,您可以在这里发布二手设备、产品信息,
  8. 展示期为3个月;为了完整展示您的商品,请您认真填写以下商品基本信息,
  9. 后续采美工作人员将联系您进行承诺书签名,谢谢合作。
  10. </view>
  11. </view>
  12. <view class="row">
  13. <view class="label">发布身份:</view>
  14. <view class="select spacing">
  15. <picker
  16. @change="bindPickerChangePublisher($event)"
  17. :value="index"
  18. :range="publisherActions"
  19. range-key="name"
  20. >
  21. <input
  22. class="input"
  23. type="text"
  24. disabled="true"
  25. v-model="publisherText"
  26. placeholder="请选择发布身份"
  27. placeholder-class="placeholder"
  28. />
  29. </picker>
  30. </view>
  31. <text class="iconfont icon-xiayibu"></text>
  32. </view>
  33. <view class="row">
  34. <view class="label">二手分类:</view>
  35. <view class="select spacing">
  36. <picker
  37. @change="bindPickerChange($event)"
  38. :value="index"
  39. :range="categoryActions"
  40. range-key="name"
  41. >
  42. <input
  43. class="input"
  44. type="text"
  45. disabled="true"
  46. v-model="organizationTypeText"
  47. placeholder="请选择分类"
  48. placeholder-class="placeholder"
  49. />
  50. </picker>
  51. </view>
  52. <text class="iconfont icon-xiayibu"></text>
  53. </view>
  54. <view class="row">
  55. <view class="label">商品品牌:</view>
  56. <view class="select spacing">
  57. <picker
  58. @change="bindPickerChangeBrand($event)"
  59. :value="index"
  60. :range="brandActions"
  61. range-key="name"
  62. >
  63. <input
  64. class="input"
  65. type="text"
  66. disabled="true"
  67. v-model="brandName"
  68. placeholder="请选择品牌"
  69. placeholder-class="placeholder"
  70. />
  71. </picker>
  72. </view>
  73. <text class="iconfont icon-xiayibu"></text>
  74. </view>
  75. <view class="row" v-if="secondParams.brandId==161">
  76. <view class="label">其它品牌:</view>
  77. <view class="spacing">
  78. <input type="text"
  79. maxlength="40"
  80. v-model="secondParams.brandName"
  81. placeholder="请输入商品品牌"
  82. placeholder-class="placeholder">
  83. </view>
  84. </view>
  85. <view class="row">
  86. <view class="label">商品名称:</view>
  87. <view class="spacing">
  88. <input type="text"
  89. maxlength="40"
  90. v-model="secondParams.name"
  91. placeholder="请输入商品名称,不超过40个汉字"
  92. placeholder-class="placeholder">
  93. </view>
  94. </view>
  95. <view class="row">
  96. <view class="label">出厂日期:</view>
  97. <view class="spacing">
  98. <input type="text"
  99. v-model="secondParams.fixedYears"
  100. maxlength="10"
  101. placeholder="请输入出厂日期 如:2020年06月"
  102. placeholder-class="placeholder">
  103. </view>
  104. </view>
  105. <view class="row" v-if="secondParams.publishIdentity === 2">
  106. <view class="label">公司名称:</view>
  107. <view class="spacing">
  108. <input type="text"
  109. v-model="secondParams.companyName"
  110. maxlength="30"
  111. placeholder="请输入公司名称,不超过30个汉字"
  112. placeholder-class="placeholder">
  113. </view>
  114. </view>
  115. <view class="row">
  116. <view class="label">交易价:</view>
  117. <view class="spacing">
  118. <input type="text" maxlength="20" v-model="secondParams.price" placeholder="请输入交易价" placeholder-class="placeholder">
  119. </view>
  120. </view>
  121. <view style="margin-top: 15rpx;">
  122. <text class="iconfont xiangliao"
  123. :class="vShow_detailTalkFlag ? 'icon-jiagexiangliao':'icon-juxingweigouxuan'"
  124. @click="Detailed($event)">
  125. <text class='pricecolor' >价格详聊</text>
  126. </text>
  127. <text class="showflag" v-show="vShow_detailTalkFlag">(勾选代表同意不显示交易价)</text>
  128. </view>
  129. <!-- <view class="row" v-show="secondParams.secondHandType==2">
  130. <view class="label">市场价</view>
  131. <view class="spacing">
  132. <input type="text" v-model="secondParams.normalPrice" maxlength="30" placeholder="请输入市场价" placeholder-class="placeholder">
  133. </view>
  134. </view> -->
  135. <!-- <view class="row" v-show="secondParams.secondHandType==2">
  136. <view class="label second">采购价/原价</view>
  137. <view class="spacing second">
  138. <input type="text" v-model="secondParams.originalPrice" maxlength="30" placeholder="请输入采购价/原价" placeholder-class="placeholder"/>
  139. </view>
  140. </view>
  141. <view class="row" v-show="secondParams.secondHandType==2">
  142. <view class="label">数量</view>
  143. <view class="spacing">
  144. <input type="text" v-model="secondParams.stock" maxlength="30" placeholder="请输入数量" placeholder-class="placeholder">
  145. </view>
  146. </view> -->
  147. <view class="row">
  148. <view class="label">商品成色:</view>
  149. <view class="spacing">
  150. <input type="text"
  151. maxlength="10"
  152. v-model="secondParams.productQuality"
  153. placeholder="请输入商品成色,如“9成新”"
  154. placeholder-class="placeholder">
  155. </view>
  156. </view>
  157. <view class="row none">
  158. <view class="label">商品包含的文件:</view>
  159. </view>
  160. <view class="row none">
  161. <view class="checkbox-main">
  162. <view
  163. class="checkbox-list"
  164. :class="type.isChecked ? 'checked' : ''"
  165. v-for="(type, index) in productFileTypeActions"
  166. :key="index"
  167. @click="choiceProductFileType(type, index)"
  168. >
  169. <text class="iconfont" :class="type.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"></text>
  170. {{ type.name }}
  171. </view>
  172. </view>
  173. </view>
  174. <view class="row">
  175. <view class="label">联系人:</view>
  176. <view class="spacing">
  177. <input type="text"
  178. maxlength="15"
  179. v-model="secondParams.contactName"
  180. placeholder="请输入联系人姓名"
  181. placeholder-class="placeholder">
  182. </view>
  183. </view>
  184. <view class="row">
  185. <view class="label">联系方式:</view>
  186. <view class="spacing">
  187. <input type="text"
  188. v-model="secondParams.contactMobile"
  189. maxlength="11"
  190. placeholder="请输入联系人手机号"
  191. placeholder-class="placeholder">
  192. </view>
  193. </view>
  194. <view class="row none" v-if="secondParams.publishIdentity === 1">
  195. <view class="label-im">身份证照片:</view>
  196. <view class="label-em">个人请上传身份证正面照片(图片大小不超过5M)</view>
  197. <view class="release-input upload image uploadGoodsImages" >
  198. <view class="upload-file-view">
  199. <view class="upload-file" v-if="secondParams.authenticationImage == ''">
  200. <text class="iconfont icon-shangchuantupian"></text>
  201. <text class="add-text">身份证正面</text>
  202. <view ref="goodsImages" class="input-file" @click="uploadCardImageFn(1)"></view>
  203. </view>
  204. <view class="upload-file" v-else>
  205. <image :src="secondParams.authenticationImage" alt="" class="upload-img" ></image>
  206. <text class=" del iconfont icon-iconfontguanbi" @click="removeCardImageFn(1)"></text>
  207. </view>
  208. </view>
  209. <view class="upload-file-view">
  210. <view class="upload-file" v-if="secondParams.authenticationBackImage == ''">
  211. <text class="iconfont icon-shangchuantupian"></text>
  212. <text class="add-text">身份证反面</text>
  213. <view ref="goodsImages" class="input-file" @click="uploadCardImageFn(2)"></view>
  214. </view>
  215. <view class="upload-file" v-else>
  216. <image :src="secondParams.authenticationBackImage" alt="" class="upload-img" ></image>
  217. <text class=" del iconfont icon-iconfontguanbi" @click="removeCardImageFn(2)"></text>
  218. </view>
  219. </view>
  220. </view>
  221. </view>
  222. <view class="row none" v-if="secondParams.publishIdentity === 2">
  223. <view class="label-im">营业执照:</view>
  224. <view class="label-em">请上传营业执照照片(图片大小不超过5M)</view>
  225. <view class="release-input upload image uploadGoodsImages" >
  226. <view class="upload-file" v-if="secondParams.licenseImage == ''">
  227. <text class="iconfont icon-shangchuantupian"></text>
  228. <text class="add-text">营业执照</text>
  229. <view ref="goodsImages" class="input-file" @click="uploadUserImageFn"></view>
  230. </view>
  231. <view class="upload-file" v-else>
  232. <image :src="secondParams.licenseImage" alt="" class="upload-img" ></image>
  233. <i class=" del iconfont icon-iconfontguanbi" @click="removeUserImageFn"></i>
  234. </view>
  235. </view>
  236. </view>
  237. <view class="row">
  238. <view class="label">采美对接人:</view>
  239. <view class="spacing">
  240. <input type="text"
  241. v-model="secondParams.dockingPeopleName"
  242. maxlength="15"
  243. placeholder="请输入采美对接人姓名"
  244. placeholder-class="placeholder">
  245. </view>
  246. </view>
  247. <view class="row">
  248. <view class="label">对接人联系方式:</view>
  249. <view class="spacing">
  250. <input type="text"
  251. v-model="secondParams.dockingPeopleMobile"
  252. maxlength="11" placeholder="请输入采美对接人手机号"
  253. placeholder-class="placeholder">
  254. </view>
  255. </view>
  256. <view class="row">
  257. <view class="label">商品类型:</view>
  258. <view class="select spacing">
  259. <picker
  260. @change="bindPickerChangeProduct($event)"
  261. :value="index"
  262. :range="productActions"
  263. range-key="name"
  264. >
  265. <input
  266. class="input"
  267. type="text"
  268. disabled="true"
  269. v-model="organizationTypeText1"
  270. placeholder="请选择发布身份"
  271. placeholder-class="placeholder"
  272. />
  273. </picker>
  274. </view>
  275. <text class="iconfont icon-xiayibu"></text>
  276. </view>
  277. <view class="row" >
  278. <view class="label">联系地址:</view>
  279. <view class="spacing" @click="showMulLinkageThreePicker">
  280. <text class="row-input" :class="addressData.address === '请选择所在地区' ? 'none,placeholder' : ''" >
  281. {{addressData.address}}
  282. </text>
  283. </view>
  284. <text class="iconfont icon-xiayibu"></text>
  285. </view>
  286. <textarea type="text"
  287. class="border-grey address-details"
  288. v-model="secondParams.address"
  289. maxlength="50"
  290. placeholder="请填写详细地址,如街道/小区/门牌等"
  291. placeholder-class="placeholder"/>
  292. </textarea>
  293. <view class="release-main-container">
  294. <view class="release-from">
  295. <view class="label">商品图片</view>
  296. <view class="release-input upload image uploadGoodsImages" >
  297. <view class="upload-file" v-if="GoodsImagesList.length<5">
  298. <text class="iconfont icon-shangchuantupian"></text>
  299. <p class="add-text">商品图片</p>
  300. <view ref="goodsImages" class="input-file" @click="uploadGoodsImagesFn"></view>
  301. </view>
  302. <view class="upload-file" v-for="(item, index) in GoodsImagesList" :key="index">
  303. <image :data-original='item' :src="item" :data-image="item" alt="" class="upload-img" ></image>
  304. <text class=" del iconfont icon-iconfontguanbi" @click="removeGoodsImagesFn(index)"></text>
  305. </view>
  306. </view>
  307. <view class="form-upload-tips">
  308. <text class="iconfont icon-wenhao" ></text>
  309. <view class="wen-tips" >最多上传5张二手商品图片,请尽量全部上传,单张图片不能超过5M</view>
  310. </view>
  311. </view>
  312. <view class="row">
  313. <view class="label-im">二手出让承诺函签署文件:</view>
  314. <view class="label-em">(仅支持pdf文件,大小不能超过20)</view>
  315. <view class="spacing file-none" v-if="secondParams.fileName == ''">
  316. <view class="file-none-button" @click="uploadCommitmentFile">上传</view>
  317. </view>
  318. <view class="spacing file-text" v-else>
  319. <text class="file-text-em">{{ secondParams.fileName }}</text>
  320. <text class=" del iconfont icon-iconfontguanbi" @click="deleteCommitmentFile"></text>
  321. </view>
  322. </view>
  323. <view class="row none">
  324. <view class="label-im">二手出让承诺函签署图片</view>
  325. <view class="label-em">(若不方便上传承诺函签署文件,可对已签署的承诺函进行拍照或者截图再上传图片)</view>
  326. <view class="label-em">图片大小不超过5M</view>
  327. <view class="release-input upload image uploadGoodsImages" >
  328. <view class="upload-file" v-if="secondParams.commitmentImage == ''">
  329. <i class="iconfont icon-shangchuantupian"></i>
  330. <text class="add-text">承诺函图片</text>
  331. <view ref="goodsImages" class="input-file" @click="uploadCommitmentImageFn"></view>
  332. </view>
  333. <view class="upload-file" v-else>
  334. <image :src="secondParams.commitmentImage" alt="" class="upload-img" ></image>
  335. <i class=" del iconfont icon-iconfontguanbi" @click="removeCommitmentImageFn"></i>
  336. </view>
  337. </view>
  338. </view>
  339. <view class="productinfo">
  340. <view class="label unlogin-label" style="width: 100%;">商品详细信息</view>
  341. <view class="textarea-wrapper">
  342. <textarea class="textarea"
  343. type="text"
  344. v-model="secondParams.productDetails"
  345. placeholder="请填写商品详细信息,对商品进行更详细的描述"
  346. placeholder-class="placeholder"
  347. maxlength="200"
  348. @input="onTextareaInputInfo"
  349. />
  350. <span class="word-limit">{{secondParams.productDetails.length}}/200</span>
  351. </view>
  352. </view>
  353. </view>
  354. </view>
  355. <view class="secondBj thebj" v-show="model1" :class="model1 ? 'show':''">
  356. <view class="bjmain theresult">
  357. <text class="title">发布提示</text>
  358. <text class="content"> {{ tipsContentText }} </text>
  359. <view class="paybtn">
  360. <view class="btn cancel" @click.stop="cancelButtonFn">{{ cancelButtonText }}</view>
  361. <view class="btn confirm" @click.stop="confirmButtonFn">{{ confirmButtonText }}</view>
  362. </view>
  363. </view>
  364. </view>
  365. <!-- 地址弹窗 -->
  366. <mpvue-city-picker :themeColor="themeColor"
  367. ref="mpvueCityPicker"
  368. :pickerValueDefault="cityPickerValueDefault"
  369. @onCancel="onCancel"
  370. @onConfirm="onConfirm">
  371. </mpvue-city-picker>
  372. <!-- 发布按钮 -->
  373. <tui-bottom-popup :radius="false" :mask="false" :show="popupShow">
  374. <view class="tui-popup-box clearfix">
  375. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  376. <view class="tui-flex-1">
  377. <view class="tui-button-text" @click="handleChangAgree">
  378. <text @click="changeBox($event)"
  379. class="iconfont"
  380. :class="checkbox ? 'icon-yixuanze':'icon-weixuanze'" >
  381. </text>
  382. 已阅读并同意采美<text style="color:#1890f9;">《二手出让协议》</text>
  383. </view>
  384. </view>
  385. <view class="tui-flex-1">
  386. <view class="tui-button" @click="handleSubmitBtn">发布</view>
  387. </view>
  388. </view>
  389. </view>
  390. </tui-bottom-popup>
  391. <!-- 弹窗提示 -->
  392. <tui-modal :show="modal" :padding="'40rpx 30rpx'" @cancel="hideMobel" :custom="true" fadeIn >
  393. <view class="tui-modal-custom">
  394. <view class="tui-prompt-text">
  395. {{ contentModalText }}
  396. </view>
  397. <view class="tui-prompt-flex">
  398. <view class="btn btn-confirm" @click="handleClick">确定</view>
  399. </view>
  400. </view>
  401. </tui-modal>
  402. </view>
  403. </template>
  404. <script>
  405. import mpvueCityPicker from '@/components/mpvue-citypicker/mpvueCityPicker.vue'
  406. import { uploadFileImage , uploadFilePdf } from '@/services/public.js'
  407. import authorize from '@/common/config/authorize.js'
  408. import $reg from '@/common/config/common.js'
  409. import { mapState,mapMutations } from 'vuex'
  410. export default{
  411. name:'secondHandrelease',
  412. components:{
  413. mpvueCityPicker,
  414. },
  415. data(){
  416. return{
  417. isIphoneX: this.$store.state.isIphoneX,
  418. popupShow:true,
  419. userIdentity:0,
  420. publisherText:'请选择发布身份',
  421. organizationTypeText:'请选择二手分类',
  422. organizationTypeText1:'请选择商品类型',
  423. brandActions:[],
  424. publisherActions:[
  425. {name:'个人身份',value:1},
  426. {name:'公司身份',value:2},
  427. ],
  428. categoryActions:[
  429. {name:'二手仪器',value:1},
  430. {name:'其他',value:3},
  431. ],
  432. productActions:[
  433. {name:'医美',value:1},
  434. {name:'非医美',value:3},
  435. ],
  436. productFileTypeActions:[
  437. { name:'仪器原始合同',value:1,isChecked:false},
  438. { name:'仪器注册证',value:2,isChecked:false},
  439. { name:'仪器发票',value:3,isChecked:false},
  440. { name:'仪器报关单',value:4,isChecked:false},
  441. { name:'无任何文件',value:5,isChecked:false}
  442. ],
  443. GoodsImagesList:[],
  444. secondParams:{
  445. publishIdentity:1, // 发布者身份 1 个人身份 2 公司身份
  446. secondHandType:'',//一级分类
  447. instrumentType:1,//二手仪器分类
  448. name:'',
  449. brandId:'',//品牌ID
  450. brandName:'',//其他品牌
  451. fixedYears:'',//出厂
  452. companyName:'',//公司名称
  453. maturityYears:'',//产品到期
  454. price:'',//交易价
  455. detailTalkFlag:1,//是否启用详聊
  456. normalPrice:'',//市场价
  457. originalPrice:'',//采购价
  458. stock:'',//数量
  459. productQuality:'',//商品成色
  460. contactName:'',//联系人
  461. contactMobile:'',//联系方式
  462. authenticationImage:'', //身份证正面
  463. authenticationBackImage:'', //身份证反面
  464. licenseImage:'',//身份验证图片
  465. commitmentImage:'',//承诺函图片
  466. dockingPeopleName:'',//采美对接人姓名
  467. dockingPeopleMobile:'',//采美对接人手机号
  468. secondProductType:'',//
  469. townId:'',//县区地址
  470. address:'',//详细地址
  471. image:'',//图片
  472. fileName:'',
  473. ossName:'',
  474. productDetails:'',//商品详细信息
  475. source:2//二手发布来源.1:WWW,2:小程序,3:后台,4:协销
  476. },
  477. checkedFileTypeList:[],
  478. addressData:{
  479. address:'请选择所在地区',
  480. townID:'', //区ID
  481. cityID:'', //区ID
  482. provinceID:'', //区ID
  483. addressDetail: '', //地址
  484. },
  485. brandName:'请选择品牌名称',
  486. checkbox:false,
  487. tipsContentText:'',
  488. cancelButtonText:'取消发布',
  489. confirmButtonText:'去支付',
  490. contentModalText:'发布成功!商品信息会在1-2个工作日内进行审核,审核通过后将立即上线到采美二手市场',
  491. isButtonsType:0,
  492. vShow_detailTalkFlag:false,
  493. modal:false,
  494. model1:false
  495. }
  496. },
  497. methods:{
  498. onTextareaInputInfo(e){
  499. this.secondParams.productDetails = e.detail.value
  500. },
  501. showMulLinkageThreePicker() {//三级地址联动
  502. this.isShowInput = true
  503. this.$refs.mpvueCityPicker.show()
  504. },
  505. onConfirm(e) {//获取选择的地址信息
  506. this.addressData.address = e.name
  507. this.addressData.townID = e.townCode
  508. this.addressData.cityID = e.cityCode
  509. this.addressData.provinceID = e.provinceCode
  510. this.secondParams.townId = this.addressData.townID
  511. },
  512. bindPickerChangePublisher(e) {// 选择发布者身份
  513. this.publisherText = this.publisherActions[e.target.value].name
  514. this.secondParams.publishIdentity = this.publisherActions[e.target.value].value
  515. },
  516. bindPickerChange(e) {// 选择二手分类
  517. this.secondParams.secondHandType = this.categoryActions[e.target.value].value
  518. if(this.secondParams.secondHandType === 1){
  519. this.organizationTypeText = '二手仪器-美容仪器'
  520. }else{
  521. this.organizationTypeText = this.categoryActions[e.target.value].name
  522. }
  523. },
  524. bindPickerChangeBrand(e) {
  525. // 选择品牌
  526. this.brandName = this.brandActions[e.target.value].name
  527. this.secondParams.brandId = this.brandActions[e.target.value].value
  528. },
  529. bindPickerChangeProduct(e) {
  530. // 选择商品类型
  531. this.organizationTypeText1 = this.productActions[e.target.value].name
  532. this.secondParams.secondProductType = this.productActions[e.target.value].value
  533. },
  534. choiceProductFileType(type,index){
  535. // 选择类别
  536. type.isChecked = !type.isChecked
  537. if (type.isChecked) {
  538. if(!this.contains(this.checkedFileTypeList,type.value)){
  539. this.checkedFileTypeList.push(type.value)
  540. }
  541. } else {
  542. this.checkedFileTypeList.splice(this.checkedFileTypeList.indexOf(type.value),1)
  543. }
  544. this.secondParams.fileType = this.checkedFileTypeList.join(',')
  545. },
  546. contains(arr, val) {// 校验
  547. return arr.some(item => item === val)
  548. },
  549. Detailed(){
  550. this.vShow_detailTalkFlag = !this.vShow_detailTalkFlag
  551. if(this.vShow_detailTalkFlag){
  552. this.secondParams.detailTalkFlag = 2 //启用价格详聊
  553. }else {
  554. this.secondParams.detailTalkFlag = 1 //不启用价格详聊
  555. }
  556. },
  557. uploadGoodsImagesFn(event){//上传商品图片
  558. uploadFileImage().then(res =>{
  559. this.GoodsImagesList.push(JSON.parse(res.data).data)
  560. this.secondParams.image =this.GoodsImagesList.toString()+','
  561. })
  562. },
  563. uploadCardImageFn(type){//上传身份正反面照
  564. uploadFileImage().then(res =>{
  565. if(type == 1){
  566. this.secondParams.authenticationImage = JSON.parse(res.data).data
  567. }else{
  568. this.secondParams.authenticationBackImage = JSON.parse(res.data).data
  569. }
  570. })
  571. },
  572. uploadUserImageFn(event){//上传营业执照图片
  573. console.log('event')
  574. uploadFileImage().then(res =>{
  575. this.secondParams.licenseImage = JSON.parse(res.data).data
  576. })
  577. },
  578. uploadCommitmentImageFn(event){//上传承诺函图片
  579. uploadFileImage().then(res =>{
  580. this.secondParams.commitmentImage = JSON.parse(res.data).data
  581. })
  582. },
  583. uploadCommitmentFile(){//上传承诺函文件
  584. uploadFilePdf().then(res =>{
  585. let data = JSON.parse(res.data).data
  586. this.secondParams.fileName = uni.getStorageSync('fileName')
  587. this.secondParams.ossName = data.ossName
  588. console.log('fileName',this.secondParams.fileName)
  589. console.log('ossName',this.secondParams.ossName)
  590. })
  591. },
  592. deleteCommitmentFile(){//删除承诺函文件
  593. this.secondParams.fileName = ''
  594. },
  595. removeGoodsImagesFn(index){//删除商品图片
  596. this.GoodsImagesList.splice(index,1)
  597. this.secondParams.image =this.GoodsImagesList.toString()+','
  598. },
  599. removeCardImageFn(type){//删除身份证图片
  600. if(type == 1){
  601. this.secondParams.authenticationImage = ''
  602. }else{
  603. this.secondParams.authenticationBackImage = ''
  604. }
  605. },
  606. removeUserImageFn(index){//删除公司营业执照图片
  607. this.secondParams.licenseImage = ''
  608. },
  609. removeCommitmentImageFn(index){//删除承诺函图片
  610. this.secondParams.commitmentImage = ''
  611. },
  612. handleSubmitBtn () {
  613. if(this.secondParams.secondHandType == ''){
  614. this.$util.msg('请选择分类',2000)
  615. return
  616. }
  617. if(this.secondParams.secondHandType == 1 ){
  618. if(this.secondParams.instrumentType ==''){
  619. this.$util.msg('请完善仪器分类',2000)
  620. return
  621. }
  622. }
  623. if(this.secondParams.brandId == ''){
  624. this.$util.msg('请选择商品品牌',2000)
  625. return
  626. }
  627. if(this.secondParams.name == ''){
  628. this.$util.msg('请输入商品名称',2000)
  629. return
  630. }
  631. // if(this.secondParams.secondHandType ==2) {
  632. // if (this.secondParams.maturityYears=='') {
  633. // this.$util.msg('请输入产品到期日',2000);
  634. // return
  635. // }
  636. // }
  637. if(!this.$api.isNumber(this.secondParams.price)){
  638. this.$util.msg('请输入交易价',2000)
  639. return
  640. }
  641. // if(this.secondParams.secondHandType ==2) {
  642. // if (!this.$api.isNumber(this.secondParams.normalPrice)) {
  643. // this.$util.msg('请输入市场价',2000);
  644. // return
  645. // }
  646. // if(!this.$api.isNumber(this.secondParams.originalPrice)){
  647. // this.$util.msg('请输入采购价/原价',2000);
  648. // return
  649. // }
  650. // if(!this.$api.isNumber(this.secondParams.stock)){
  651. // this.$util.msg('请输入数量',2000);
  652. // return
  653. // }
  654. // }
  655. if(this.secondParams.productQuality == ''){
  656. this.$util.msg('请输入商品成色',2000)
  657. return
  658. }
  659. if(this.secondParams.contactName == ''){
  660. this.$util.msg('请输入联系人姓名',2000)
  661. return
  662. }
  663. if(this.secondParams.contactMobile == ''){
  664. console.log(this.secondParams.contactMobile)
  665. this.$util.msg('请输入联系方式',2000)
  666. return
  667. }
  668. if(!$reg.isMobile(this.secondParams.contactMobile)){
  669. this.$util.msg('请填写正确的手机号',2000)
  670. return
  671. }
  672. if(this.userIdentity === 1){
  673. if(this.secondParams.dockingPeopleName == ''){
  674. this.$util.msg('请输入采美对接人姓名',2000)
  675. return
  676. }
  677. if(this.secondParams.dockingPeopleMobile == ''){
  678. this.$util.msg('请输入采美对接人手机号',2000)
  679. return
  680. }
  681. }
  682. if(this.secondParams.dockingPeopleMobile !=''){
  683. if(!$reg.isMobile(this.secondParams.dockingPeopleMobile)){
  684. this.$util.msg('请填写正确的采美对接人手机号',2000)
  685. return
  686. }
  687. }
  688. if(this.secondParams.townId == ''|| this.secondParams.townId == undefined){
  689. this.$util.msg('请完善联系地址',2000)
  690. return
  691. }
  692. if(this.secondParams.address == ''){
  693. this.$util.msg('请填写详细地址',2000)
  694. return
  695. }
  696. if(this.GoodsImagesList ==''){
  697. this.$util.msg('请上传图片',2000)
  698. return
  699. }
  700. if(this.checkbox==false){
  701. this.$util.msg('请勾选已阅读',2000)
  702. return
  703. }
  704. console.log(this.secondParams)
  705. if(this.secondParams.licenseImage == ''){
  706. this.model1 = true
  707. this.tipsContentText = '上传身份验证照片,您的二手商品将获得更好的推荐推荐和曝光,方便您快速卖出。'
  708. this.cancelButtonText = '继续发布'
  709. this.confirmButtonText = '去上传'
  710. this.isButtonsType = 1
  711. return
  712. }
  713. if(this.secondParams.commitmentImage == '' || this.secondParams.ossName == ''){
  714. this.model1 = true
  715. this.tipsContentText = '上传二手出让承诺函,您的二手商品将获得更好的推荐推荐和曝光,方便您快速卖出。'
  716. this.cancelButtonText = '继续发布'
  717. this.confirmButtonText = '去上传'
  718. this.isButtonsType = 1
  719. return
  720. }
  721. this.SecondHandProduct()
  722. },
  723. SecondHandProduct(){//提交发布
  724. this.SecondService.SecondHandProduct(this.secondParams).then(res=>{
  725. this.model = true
  726. }).catch(error =>{
  727. this.$util.msg(error.msg,2000)
  728. })
  729. },
  730. cancelButtonFn(){//弹窗操作按钮
  731. switch(this.isButtonsType){
  732. case 1:
  733. this.SecondHandProduct(this.secondParams)
  734. break
  735. case 2:
  736. this.model1 = false
  737. break
  738. }
  739. },
  740. confirmButtonFn(){//弹窗操作按钮
  741. switch(this.isButtonsType){
  742. case 1:
  743. this.model1 = false
  744. break
  745. case 2:
  746. this.model1 = false
  747. break
  748. }
  749. },
  750. handleChangAgree() {
  751. this.checkbox = !this.checkbox
  752. },
  753. getBrandList() {
  754. // 获取收款类型列表
  755. this.SecondService.brandList()
  756. .then(response => {
  757. this.brandActions = response.data.map(item => ({
  758. ...item,
  759. name: item.name,
  760. value: item.id
  761. }))
  762. })
  763. .catch(err => {
  764. this.$util.msg(err.msg, 2000)
  765. })
  766. },
  767. hideMobel(){
  768. this.modal = false
  769. },
  770. handleClick(){
  771. this.modal = false
  772. this.$api.navigateTo('/pages/second/product/product-list')
  773. }
  774. },
  775. onShow() {
  776. this.getBrandList()
  777. this.$api.getComStorage('userInfo').then((resolve) =>{
  778. this.userIdentity = resolve.userIdentity
  779. console.log(this.userIdentity)
  780. }).catch(error =>{
  781. console.log(error)
  782. })
  783. }
  784. }
  785. </script>
  786. <style lang="scss">
  787. view{font-size: 28rpx;}
  788. .my-maintenance{
  789. padding: 20rpx;
  790. }
  791. .bannerimg {
  792. height: 66rpx;
  793. width: 100%;
  794. }
  795. .bannerimg image{
  796. width: 100%;
  797. height: 100% ;
  798. }
  799. .newsTitle {
  800. line-height: 48rpx;
  801. text-align: left;
  802. color: #e15616;
  803. padding:20rpx;
  804. background-color: rgba(225, 86, 22, .1);
  805. border-radius: 8rpx;
  806. }
  807. .nestext{
  808. font-size: 24rpx;
  809. line-height: 44rpx;
  810. }
  811. .secondradio view{
  812. display: inline-block;
  813. color: #333333;
  814. margin-right: 21rpx;
  815. }
  816. .secondradio{
  817. display: inline-block;
  818. margin-left: 40rpx;
  819. }
  820. .Secondary{
  821. margin-left: 96rpx;
  822. }
  823. .secondradio view.active {
  824. color: #e15616;
  825. }
  826. .placeholder{
  827. color: #b2b2b2;
  828. }
  829. .linqi_text {
  830. width: 607rpx;
  831. height: 68rpx;
  832. background-color: #1890f9;
  833. box-shadow: 0rpx 4rpx 6rpx 0rpx rgba(24, 144, 249, 0.17);
  834. text-align: center;
  835. line-height: 68rpx;
  836. color: #ffffff;
  837. margin: auto;
  838. font-size:24rpx;
  839. position: relative;
  840. }
  841. .jiaobiao {
  842. width: 0;
  843. height: 0;
  844. border-left: 20rpx solid transparent;
  845. border-right: 20rpx solid transparent;
  846. top: -25%;
  847. right: 40%;
  848. border-bottom: 20rpx solid #1890f9;
  849. position: absolute;
  850. }
  851. .label{
  852. color: #666666;
  853. display: inline-block;
  854. }
  855. .label-im{
  856. width: 100%;
  857. line-height: 50rpx;
  858. font-size: $font-size-28;
  859. color: #666666;
  860. text-align: left;
  861. margin-top: 20rpx;
  862. }
  863. .label-em{
  864. line-height: 28rpx;
  865. font-size: $font-size-20;
  866. color: #fea785;
  867. width: 100%;
  868. text-align: left;
  869. }
  870. .label.second{
  871. width: 155rpx;
  872. }
  873. .row .spacing.second{
  874. width: 70%;
  875. }
  876. .row{
  877. width: 100%;
  878. border-bottom: 2rpx solid #e1e1e1;
  879. line-height: 90rpx;
  880. float: left;
  881. height: auto;
  882. position: relative;
  883. .checkbox-main{
  884. width: 100%;
  885. .checkbox-list {
  886. height: 60rpx;
  887. font-size: $font-size-28;
  888. line-height: 60rpx;
  889. border-radius: 10rpx;
  890. margin-right: 20rpx;
  891. margin-bottom: 10rpx;
  892. box-sizing: border-box;
  893. float: left;
  894. .icon-yixuanze{
  895. margin-right: 10rpx;
  896. color: #E15616;
  897. }
  898. .icon-weixuanze{
  899. margin-right: 10rpx;
  900. color: #B2B2B2;
  901. }
  902. }
  903. }
  904. &.none{
  905. border-bottom: none;
  906. }
  907. }
  908. .row.fenlei{
  909. height: auto;
  910. margin: 10rpx 0;
  911. border: 0;
  912. }
  913. .select {
  914. position: relative;
  915. color: #b2b2b2;
  916. text-align: left;
  917. user-select: none;
  918. }
  919. .row .spacing{
  920. display: inline-block;
  921. margin-left: 50rpx;
  922. width: 430rpx;
  923. vertical-align:middle;
  924. position: relative;
  925. color: #333333;
  926. .input{
  927. color: #333333;
  928. }
  929. &.file{
  930. width: 100%;
  931. }
  932. &.file-text{
  933. width: 100%;
  934. line-height: 44rpx;
  935. font-size: 28rpx;
  936. box-sizing: border-box;
  937. margin-left: 0;
  938. .file-text-em{
  939. width: 100%;
  940. text-overflow: ellipsis;
  941. overflow: hidden;
  942. display: -webkit-box;
  943. -webkit-line-clamp: 1;
  944. line-clamp: 1;
  945. -webkit-box-orient: vertical;
  946. line-height: 44rpx;
  947. font-size: 28rpx;
  948. padding-right: 40rpx;
  949. box-sizing: border-box;
  950. position: relative;
  951. }
  952. .icon-iconfontguanbi{
  953. width: 40rpx;
  954. height: 40rpx;
  955. line-height: 40rpx;
  956. display: block;
  957. position: absolute;
  958. top: 0;
  959. right:0;
  960. color: #f94b4b;
  961. font-size: 36rpx;
  962. }
  963. }
  964. &.file-none{
  965. width: 100%;
  966. margin-left: 0;
  967. position: relative;
  968. .file-none-button{
  969. width: 88rpx;
  970. height: 44rpx;
  971. background-color: #e15616;
  972. border-radius: 8rpx;
  973. line-height: 44rpx;
  974. text-align: center;
  975. font-size: 24rpx;
  976. color: #FFFFFF;
  977. position: absolute;
  978. right: 0;
  979. top: -15rpx;
  980. }
  981. }
  982. }
  983. .select .placeholder {
  984. position: relative;
  985. cursor: pointer;
  986. width: 100%;
  987. display: inline-block;
  988. }
  989. .icon-xiayibu{
  990. right: 0rpx;
  991. color: #b2b2b2;
  992. position: absolute;
  993. }
  994. .xiangliao{
  995. font-size: 26rpx;
  996. margin-right: 10rpx;
  997. color: #b2b2b2;
  998. }
  999. .icon-jiagexiangliao{
  1000. color: #e15616 !important;
  1001. }
  1002. .pricecolor{
  1003. margin-left: 10rpx;
  1004. }
  1005. .showflag{
  1006. color: #b2b2b2;
  1007. }
  1008. .border-grey{
  1009. width: 100%;
  1010. resize: none;
  1011. padding: 20rpx 0;
  1012. height: 160rpx;
  1013. border-bottom: 2rpx solid #e1e1e1;
  1014. }
  1015. .release-main-container {
  1016. overflow: hidden;
  1017. margin: 20rpx 0;
  1018. }
  1019. .uploadGoodsImages{
  1020. display: flex;
  1021. overflow-x: auto;
  1022. overflow-y: hidden;
  1023. }
  1024. .secondradio{
  1025. .row-radio{
  1026. transform: scale(.8);
  1027. }
  1028. .row-input{margin-right: 10rpx;}
  1029. }
  1030. .linqi_text .p{
  1031. font-size: $font-size-20;
  1032. }
  1033. .upload-file {
  1034. float: left;
  1035. margin: 20rpx 20rpx 20rpx 0px;
  1036. cursor: pointer;
  1037. width: 194rpx;
  1038. height: 194rpx;
  1039. border-radius: 6rpx;
  1040. border: solid 2rpx #e1e1e1;
  1041. flex-shrink: 0;
  1042. position: relative;
  1043. display: inline-block;
  1044. .input-file {
  1045. width: 194rpx;
  1046. height: 194rpx;
  1047. opacity: 0;
  1048. cursor: pointer;
  1049. position: absolute;
  1050. top: 0;
  1051. left: 0;
  1052. }
  1053. .upload-img {
  1054. width: 100%;
  1055. height: 100%;
  1056. display: block;
  1057. border-radius: .53vw;
  1058. }
  1059. .icon-shangchuantupian{
  1060. display: block;
  1061. width: 100%;
  1062. height: 100rpx;
  1063. line-height: 90rpx;
  1064. color: #b2b2b2;
  1065. font-size: $font-size-40;
  1066. text-align: center;
  1067. padding-top: 20rpx;
  1068. box-sizing: border-box;
  1069. }
  1070. .add-text {
  1071. display: block;
  1072. width: 100%;
  1073. line-height: 50rpx;
  1074. font-size: 24rpx;
  1075. color: #b2b2b2;
  1076. text-align: center;
  1077. }
  1078. .icon-iconfontguanbi{
  1079. width: 40rpx;
  1080. height: 40rpx;
  1081. line-height: 40rpx;
  1082. display: block;
  1083. position: absolute;
  1084. background: #f94b4b;
  1085. text-align: center;
  1086. line-height: 40rpx;
  1087. border-radius: 50%;
  1088. top: -15rpx;
  1089. right:-18rpx;
  1090. color: #FFFFFF;
  1091. font-size: $font-size-24;
  1092. }
  1093. }
  1094. .wen-tips {
  1095. width: 664rpx;
  1096. height: 68rpx;
  1097. line-height: 68rpx;
  1098. text-align: center;
  1099. color: #FFF;
  1100. font-size: 20rpx;
  1101. background-color: #1890f9;
  1102. box-shadow: 0 0.8vw 1.6vw 0 rgba(24, 144, 249, 0.17);
  1103. border-radius: 2rpx;
  1104. display: none;
  1105. }
  1106. .form-upload-tips:hover .wen-tips {
  1107. display: block;
  1108. }
  1109. .textarea-wrapper {
  1110. letter-spacing: 2rpx;
  1111. line-height: 48rpx;
  1112. color: #333333;
  1113. position: relative;
  1114. font-size: 28rpx;
  1115. border: 2rpx solid #E1E1E1;
  1116. height: 300rpx;
  1117. padding: 16rpx;
  1118. border-radius: 6rpx;
  1119. margin: 20rpx 0;
  1120. }
  1121. .textarea-wrapper textarea{
  1122. width: 100%;
  1123. }
  1124. .word-limit {
  1125. position: absolute;
  1126. right: 2.7vw;
  1127. bottom: 2.7vw;
  1128. font-size: 3.2vw;
  1129. color: #9aa5b5;
  1130. }
  1131. .row.Read{
  1132. border: 0;
  1133. text-align: center;
  1134. color: #999999;
  1135. }
  1136. .thebj {
  1137. position: fixed;
  1138. left: 0;
  1139. top: 0;
  1140. bottom: 0;
  1141. width: 100%;
  1142. height: 100%;
  1143. background-color: rgba(0, 0, 0, .5);
  1144. z-index: 999999;
  1145. opacity: 0;
  1146. }
  1147. .thebj.show{
  1148. opacity: 1;
  1149. }
  1150. .theresult {
  1151. position: absolute;
  1152. top: 50%;
  1153. left: 50%;
  1154. transform: translate(-50%, -50%);
  1155. width:580rpx;
  1156. background-color: #fff;
  1157. border-radius: 32rpx;
  1158. }
  1159. .theresult .title{
  1160. line-height: 100rpx;
  1161. text-align: center;
  1162. display: block;
  1163. color: #333333;
  1164. font-size: 30rpx;
  1165. font-weight: bold;
  1166. border-bottom: 2rpx solid #efefef;
  1167. }
  1168. .theresult .content{
  1169. padding: 30rpx 52rpx;
  1170. line-height: 48rpx;
  1171. color: #666666;
  1172. font-size: 30rpx;
  1173. display: block;
  1174. }
  1175. .paybtn{
  1176. width: 100%;
  1177. height: 90rpx;
  1178. float: left;
  1179. .btn{
  1180. width: 50%;
  1181. height: 90rpx;
  1182. text-align: center;
  1183. line-height: 90rpx;
  1184. font-size: 30rpx;
  1185. display: inline-block;
  1186. float: left;
  1187. &.cancel{
  1188. background-color: #efefef;
  1189. border-radius: 0rpx 0rpx 0rpx 32rpx;
  1190. color: #999999;
  1191. }
  1192. &.confirm{
  1193. background-image: linear-gradient(270deg, #f28f31 0%, #e15616 100%);
  1194. border-radius: 0rpx 0rpx 32rpx 0rpx;
  1195. color: #fff;
  1196. }
  1197. }
  1198. }
  1199. .icon-wenhao{
  1200. color: #1890f9;
  1201. font-size: 35rpx;
  1202. width: 50rpx;
  1203. }
  1204. .form-upload-tips:hover .wen-tips {display: block;}
  1205. .tui-popup-box {
  1206. position: relative;
  1207. box-sizing: border-box;
  1208. min-height: 100rpx;
  1209. padding: 6rpx 24rpx;
  1210. .tui-popup-content {
  1211. padding-top: 30rpx;
  1212. }
  1213. }
  1214. .tui-popup-btn {
  1215. width: 100%;
  1216. height: auto;
  1217. float: left;
  1218. box-sizing: border-box;
  1219. margin-top: 30rpx;
  1220. .tui-button {
  1221. width: 600rpx;
  1222. height: 88rpx;
  1223. background: $btn-confirm;
  1224. line-height: 88rpx;
  1225. text-align: center;
  1226. color: #ffffff;
  1227. font-size: $font-size-28;
  1228. border-radius: 44rpx;
  1229. margin: 0 auto;
  1230. }
  1231. .tui-button-text{
  1232. width: 600rpx;
  1233. height: 70rpx;
  1234. line-height: 70rpx;
  1235. text-align: center;
  1236. color: #333333;
  1237. font-size: $font-size-26;
  1238. margin: 0 auto;
  1239. margin-top: 15rpx;
  1240. .iconfont{
  1241. margin-right: 10rpx;
  1242. &.icon-yixuanze{
  1243. color: $color-system;
  1244. }
  1245. }
  1246. }
  1247. }
  1248. .tui-prompt-flex{
  1249. width: 100%;
  1250. height: 80rpx;
  1251. display: flex;
  1252. margin-top: 20rpx;
  1253. .btn{
  1254. flex: 1;
  1255. line-height: 80rpx;
  1256. font-size: $font-size-26;
  1257. text-align: center;
  1258. color: #FFFFFF;
  1259. border-radius: 40rpx;
  1260. margin: 0 24rpx;
  1261. &.btn-cancel{
  1262. background: #F7F7F7;
  1263. color: #999999;
  1264. }
  1265. &.btn-confirm{
  1266. background: $btn-confirm;
  1267. }
  1268. }
  1269. }
  1270. .tui-prompt-text{
  1271. line-height: 44rpx;
  1272. font-size: $font-size-26;
  1273. color: #333333;
  1274. .text{
  1275. color: $color-system;
  1276. }
  1277. }
  1278. </style>