flowDetails.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418
  1. <template>
  2. <view class="flowDetails">
  3. <!-- #ifdef H5 -->
  4. <!-- <view class="tab">
  5. <u-icon name="arrow-left" color="#fff" size="40" @click="goBack"></u-icon>
  6. <span>流量卡</span>
  7. <span></span>
  8. </view> -->
  9. <u-navbar back-text=" " :custom-back='goBack' title="流量卡" :border-bottom="false" :background="{backgroundColor: '#d52e4c'}" back-icon-color="#fff" title-color="#fff"></u-navbar>
  10. <!-- #endif -->
  11. <u-toast ref="uToast" />
  12. <view class="img">
  13. <image :src="showData.info.flow_images[1]" mode="widthFix"></image>
  14. </view>
  15. <view class="selectphone u-flex u-row-between" @click="openShow" v-if="showData.select_num_status==1">
  16. <text>选择号码</text>
  17. <view class="">
  18. <text class="selectText" v-if="current==null">点击选择号码,不选将随机选号</text>
  19. <text class="selectText1" v-else >{{boxList1[current]}}</text>
  20. <u-icon name="arrow-right"></u-icon>
  21. </view>
  22. </view>
  23. <view class="form">
  24. <view class="formInput">
  25. <u-form :model="form" label-width="220">
  26. <u-form-item label="姓名" v-if="!orderId">
  27. <u-input v-model="form.name" placeholder-style="font-size:26rpx;" :clearable="false"
  28. placeholder="请输入真实姓名" />
  29. </u-form-item>
  30. <view class="" v-if="!configAll.system_sms_open&&!orderId">
  31. <u-form-item label="手机号" >
  32. <u-input v-model="form.phone" placeholder-style="font-size:26rpx;" :clearable="false"
  33. placeholder="请输入手机号" />
  34. </u-form-item>
  35. </view>
  36. <u-form-item label="手机号" v-if="configAll.system_sms_open&&!orderId">
  37. <!-- -->
  38. <view class="sendSMS" v-if="configAll.system_sms_open">
  39. <view>
  40. <input type="number" maxlength="11" v-model="form.phone" placeholder-style="font-size:28rpx;" :clearable="false" placeholder="请输入手机号"/>
  41. </view>
  42. <view class="sms" >
  43. <u-verification-code :seconds="seconds" start-text="验证码" @end="end" @start="start" ref="uCode"
  44. @change="codeChange"></u-verification-code>
  45. <view class="tips" @tap="getCode" >{{tips}}</view>
  46. </view>
  47. </view>
  48. <!-- -->
  49. </u-form-item>
  50. <u-form-item label="验证码" v-if="configAll.system_sms_open&&!orderId">
  51. <input maxlength="4" v-model="form.sms_code" placeholder-style="font-size:28rpx;" :clearable="false" placeholder="请输入验证码"/>
  52. </u-form-item>
  53. <u-form-item label="身份证号" v-if="!orderId">
  54. <u-input v-model="form.id_no" placeholder-style="font-size:26rpx;" :clearable="false"
  55. placeholder="请输入身份证号" />
  56. </u-form-item>
  57. <u-form-item label="城市" v-if="!orderId">
  58. <view class="county" @tap="countyHide=!countyHide">
  59. {{countyName}}
  60. </view>
  61. <!-- 快手小程序 出现异常抖动更换 -->
  62. <!-- <u-select v-model="countyHide" :default-value='countyIndex' mode="mutil-column-auto" lchild-name="children" :list="selector" @confirm="confirm"></u-select> -->
  63. <w-picker :visible.sync="countyHide" mode="region" :value="countyIndex" default-type="value"
  64. :hide-area="false" @confirm="onConfirm($event,'region')" @cancel="onCancel" ref="region">
  65. </w-picker>
  66. </u-form-item>
  67. <u-form-item label="详细地址" v-if="!orderId">
  68. <u-input v-model="form.address" placeholder-style="font-size:26rpx;" :clearable="false"
  69. placeholder="请输入街道/镇+村/小区+门牌号 " />
  70. </u-form-item>
  71. </u-form>
  72. <view class="" v-if="showData.card_status==1||orderId">
  73. <view class="upload">
  74. <view class="flexJu">
  75. <image src="@/static/img/uUploadID11.png" mode="widthFix"></image>
  76. <image class="ding" src="../../static/img/uploadadd.png" mode=""></image>
  77. <u-upload ref="uUpload1" :multiple="false" width="600rpx" height="300rpx" max-count="1" @on-change="progress1"
  78. :action="action"></u-upload>
  79. </view>
  80. <view style="font-size: 32rpx;color: #333;margin-top: 20rpx;margin-top: 30rpx;">身份证正面照</view>
  81. <view style="color: rgba(187, 187, 187);font-size: 20rpx;margin-top: 10rpx;">
  82. 证件四角边缘空隙2厘米以上,手机横排,照片清晰不模糊,无水印,无反光,无PS</view>
  83. </view>
  84. <view class="upload">
  85. <view class="flexJu">
  86. <image src="../../static/img/uUploadID22.png" mode=""></image>
  87. <image class="ding" src="../../static/img/uploadadd.png" mode=""></image>
  88. <u-upload max-count="1" :multiple="false" ref="uUpload2" width="600rpx" height="300rpx" @on-change="progress2"
  89. :action="action"></u-upload>
  90. </view>
  91. <view style="font-size: 32rpx;color: #333;margin-top: 20rpx;margin-top: 30rpx;">身份证反面照</view>
  92. <view style="color: rgba(187, 187, 187);font-size: 20rpx;margin-top: 10rpx;">
  93. 证件四角边缘空隙2厘米以上,手机横排,照片清晰不模糊,无水印,无反光,无PS</view>
  94. </view>
  95. <view class="upload">
  96. <view class="flexJu">
  97. <image src="../../static/img/uUploadID33.png" mode=""></image>
  98. <image class="ding" src="../../static/img/uploadadd.png" mode=""></image>
  99. <u-upload max-count="1" :multiple="false" ref="uUpload3" width="600rpx" height="300rpx" @on-change="progress3"
  100. :action="action"></u-upload>
  101. </view>
  102. <view style="font-size: 32rpx;color: #333;margin-top: 20rpx;margin-top: 30rpx;">本人免冠正面照</view>
  103. <view style="color: rgba(187, 187, 187);font-size: 20rpx;margin-top: 10rpx;">
  104. 无需手持身份证,胸部以上,露出双肩,人像面部比例不低于1/3,无水印,无反光,无PS</view>
  105. </view>
  106. <!-- <view class="card">
  107. <view class="cardImg u-flex u-row-between">
  108. <image src="../../static/img/id1@2x.png" mode=""></image>
  109. <image src="../../static/img/id2@2x.png" mode=""></image>
  110. </view>
  111. <view class="cardTitle">
  112. 身份证正面照
  113. </view>
  114. <view class="intro">
  115. 证件四角边缘空隙2厘米以上,手机横拍,照片清晰
  116. 不模糊,无水印,无反光,无PS。
  117. </view>
  118. </view>
  119. <view class="card">
  120. <view class="cardImg u-flex u-row-between">
  121. <image src="../../static/img/id4@2x.png" mode=""></image>
  122. <image src="../../static/img/id2@2x.png" mode=""></image>
  123. </view>
  124. <view class="cardTitle">
  125. 身份证反面照
  126. </view>
  127. <view class="intro">
  128. 证件四角边缘空隙2厘米以上,手机横拍,照片清晰
  129. 不模糊,无水印,无反光,无PS。
  130. </view>
  131. </view>
  132. <view class="card">
  133. <view class="cardImg u-flex u-row-between">
  134. <image src="../../static/img/id3@2x.png" mode=""></image>
  135. <image src="../../static/img/id2@2x.png" mode=""></image>
  136. </view>
  137. <view class="cardTitle">
  138. 本人免冠正面照
  139. </view>
  140. <view class="intro">
  141. 无需手持身份证,胸部以上,露出双肩,人像面部比例
  142. 不低于1/3,无水印,无反光,无PS。
  143. </view>
  144. </view> -->
  145. </view>
  146. <view class="btn" @tap="apply()" v-if="!orderId">
  147. 立即领取
  148. </view>
  149. <view class="btn" @tap="submitOrder()" v-if="orderId">
  150. 立即提交
  151. </view>
  152. </view>
  153. </view>
  154. <!-- <view class="img">
  155. <image v-for="(item,index) in showData.info.flow_images" :key="index" v-if="index>1" :src="item"
  156. mode="widthFix"></image>
  157. </view> -->
  158. <view class="img">
  159. <image
  160. v-for="(item,index) in Object.keys(showData.info.flow_images).map((i,j)=>j?showData.info.flow_images[i].split(','):'').filter(i=>i).flat()"
  161. :key="index"
  162. :src="item"
  163. mode="widthFix"
  164. ></image>
  165. </view>
  166. <view class="popupBox">
  167. <view class="maskName" v-if="login_show"></view>
  168. <view class="newForm" v-if="login_show">
  169. <view class="alertContent">
  170. <view class="title">温馨提示</view>
  171. <view class="content">{{login_content}}</view>
  172. <view class="u-flex u-col-center u-row-center btn" style="border-top: 1px solid #ececec;">
  173. <text style="border-right: 1px solid #ececec;" @tap="login_cancel">取消</text>
  174. <text style="color: #D52E4C;" v-if="mixin_type=='TOUTIAO'" @tap="userLogin">确认</text>
  175. <button v-else
  176. style="box-shadow: none; background: transparent;box-sizing:border-box;width: 50%;border: 0px solid #f3f3f3;color: #D52E4C;"
  177. type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">确认</button>
  178. </view>
  179. </view>
  180. </view>
  181. </view>
  182. <u-popup v-model="show" mode="bottom" border-radius="30" height="1000">
  183. <view class="popup">
  184. <view class="search u-flex u-row-between">
  185. <view class="inputBox u-flex u-row-between">
  186. <input type="text" confirm-type="done" maxlength="11" v-model="searchNumber">
  187. <view class="searchIcon" @click="query" >
  188. <image src="../../static/img/whitesearch.png" mode=""></image>
  189. </view>
  190. </view>
  191. <view class="check">
  192. <u-checkbox-group size='20'>
  193. <u-checkbox shape="circle" @change="search_lastChange" active-color="#E30029"
  194. v-model="searchChecked" style="white-space: nowrap;">尾号</u-checkbox>
  195. </u-checkbox-group>
  196. </view>
  197. </view>
  198. <view class="" v-if="empty" style="text-align: center;margin-top:100rpx">
  199. 没有找到该号码
  200. </view>
  201. <view class="numberList u-flex u-row-between">
  202. <view class="numberItem" :class="{'selectItem':index==current}" v-for="(item,index) in boxList"
  203. @tap="ListClick(index)" :key="index">
  204. <view v-html="item"></view>
  205. </view>
  206. </view>
  207. <view class="last u-flex u-row-center" @click="query">
  208. <image src="../../static/img/reset.png" mode=""></image>
  209. <text>换一批</text>
  210. </view>
  211. <view class="btn" @tap="submit">
  212. 确认选择
  213. </view>
  214. </view>
  215. </u-popup>
  216. </view>
  217. </template>
  218. <script>
  219. import wPicker from "@/components/w-picker/w-picker.vue"
  220. import http from "@/https/request.js"
  221. import { isString } from "util"
  222. export default {
  223. data() {
  224. return {
  225. empty:false,
  226. searchNumber:'',
  227. orderId:'',
  228. tips:'',
  229. seconds: 60,//倒计时秒数
  230. // 上传地址
  231. action: '',
  232. current: null,
  233. // 列表参数
  234. listData: {
  235. city_id: "city_id", //地区id 'city_id'全部
  236. exclude_num: [], //排除 复选 值
  237. is_activity: 0, //是否是优惠号码
  238. keyword: ["1", "", "", "", "", "", "", "", "", "", ""], //搜索内容,模糊就是字符串,精准就是数组
  239. limit: 20,
  240. network: "",
  241. num_max: "", //数字较多,传数字
  242. page: 1, //
  243. price_max: "", //价格最高数字
  244. price_min: "", //价格最低数字
  245. rule_name: "", //规律名,AAAA什么的
  246. rule_position: "tail", //规律位置,middle中间,tail尾部
  247. search_last: 1, //0,1是否搜索尾部
  248. search_type: "precise", //fuzzy模糊,precise精准
  249. sort: "", //price_asc价格从低到高,price_desc价格从高到低
  250. is_offer: 0, //是否为特价号
  251. },
  252. page: 1,
  253. boxList: [],
  254. boxList1: [],
  255. searchChecked: false,
  256. show: false,
  257. id: '',
  258. countyName: '城市名称',
  259. countyHide: false,
  260. countyIndex: [1], //城市弹窗下标
  261. selector: [],
  262. showData: {
  263. info: {
  264. flow_images: []
  265. }
  266. }, //号码详情
  267. form: {
  268. sms_code:'', // 验证码
  269. address: '', //详细地址
  270. chanId: '',
  271. county: 0, //城市ID,区县id
  272. id_no: '', //身份号码,
  273. mobile_id: '',
  274. name: '', //姓名
  275. pay_type: 5,
  276. phone: '', //手机号
  277. return_url: '',
  278. clickid: '',
  279. open_idcard_face_img:'',
  280. open_idcard_back_img:'',
  281. open_face_img:'',
  282. orderId:'',
  283. no:'',
  284. platform_type: 'h5',
  285. },
  286. chanId:''
  287. }
  288. },
  289. onLoad(option) {
  290. if(option.chanId){
  291. uni.setStorageSync('chanId', option.chanId);
  292. this.chanId=option.chanId
  293. }else{
  294. uni.removeStorageSync('chanId');
  295. }
  296. // if(option.chanId){
  297. // this.form.chanId=option.chanId
  298. // }
  299. this.action = this.$httpUrl + '/api/common/upload'
  300. console.log(option)
  301. if (option.id) {
  302. this.showDetails(option.id)
  303. this.form.mobile_id = option.id
  304. }
  305. if (option.orderId) {
  306. this.orderId=option.orderId
  307. }
  308. },
  309. onShow() {
  310. this.area_tree()
  311. },
  312. components: {
  313. wPicker
  314. },
  315. methods: {
  316. goBack(){
  317. if(getCurrentPages().length==1){
  318. return
  319. }else{
  320. uni.redirectTo({
  321. url:'/pages/flow/flow?chanId='+this.chanId
  322. })
  323. }
  324. },
  325. openShow(){
  326. // this.show=true
  327. // this.searchNumber=''
  328. // this.phoneList()
  329. this.show=true
  330. if(this.current==null){
  331. this.searchNumber=''
  332. this.phoneList()
  333. }
  334. },
  335. // 获取短信
  336. getCode() {
  337. if(this.$refs.uCode.canGetCode) {
  338. if(this.form.phone==''){
  339. this.$refs.uToast.show({
  340. title: '请输入手机号',
  341. type: 'error ',
  342. })
  343. return;
  344. }
  345. if(!this.$check.checkMobile(this.form.phone)){
  346. this.$refs.uToast.show({
  347. title: '请输入正确手机号的格式',
  348. type: 'error ',
  349. })
  350. return;
  351. }
  352. // this.$u.toast('验证码已发送');
  353. // this.$refs.uCode.start();
  354. this.$http.send({mobile:this.form.phone,event:'order'})
  355. .then(res=>{
  356. if(res.data.code==1){
  357. this.$u.toast('验证码已发送');
  358. this.$refs.uCode.start();
  359. }else{
  360. this.$refs.uToast.show({
  361. title: res.data.msg,
  362. type: 'error ',
  363. })
  364. }
  365. })
  366. } else {
  367. this.$u.toast('倒计时结束后再发送');
  368. }
  369. },
  370. codeChange(text) {
  371. this.tips = text;
  372. },
  373. start() {
  374. this.$u.toast('倒计时开始');
  375. },
  376. end() {
  377. this.$u.toast('倒计时结束');
  378. },
  379. progress1(res, index, lists, name) {
  380. // console.log(JSON.parse(res.data))
  381. if (JSON.parse(res.data).code == 0) {
  382. this.$refs.uToast.show({
  383. title: JSON.parse(res.data).msg,
  384. type: 'error ',
  385. })
  386. this.$refs.uUpload1.clear()
  387. }
  388. },
  389. progress2(res, index, lists, name) {
  390. // console.log(JSON.parse(res.data))
  391. if (JSON.parse(res.data).code == 0) {
  392. this.$refs.uToast.show({
  393. title: JSON.parse(res.data).msg,
  394. type: 'error ',
  395. })
  396. this.$refs.uUpload2.clear()
  397. }
  398. },
  399. progress3(res, index, lists, name) {
  400. // console.log(JSON.parse(res.data))
  401. if (JSON.parse(res.data).code == 0) {
  402. this.$refs.uToast.show({
  403. title: JSON.parse(res.data).msg,
  404. type: 'error ',
  405. })
  406. this.$refs.uUpload3.clear()
  407. }
  408. },
  409. ListClick(index) {
  410. if (this.current != index) {
  411. this.current = index
  412. }
  413. },
  414. submit() {
  415. if(this.current==null){
  416. this.$refs.uToast.show({
  417. title: '请选择号码',
  418. type: 'error ',
  419. })
  420. return
  421. }else{
  422. this.show = false
  423. }
  424. },
  425. // 查询按钮
  426. query() {
  427. this.phoneList()
  428. },
  429. // 按照账号规则匹配
  430. numberTypeHits(type, no) {
  431. let arrStr = ''
  432. type.forEach((item, index) => {
  433. if (item) {
  434. arrStr += '<span class="active">' + no[index] + '</span>'
  435. } else {
  436. arrStr += no[index]
  437. }
  438. })
  439. return arrStr
  440. },
  441. // 搜索选中红色
  442. numberType(val,index) {
  443. let str = val+'';
  444. // console.log(str)
  445. let html, num;
  446. let first=str.substr(0, 3)
  447. let second=str.substr(3, 4)
  448. let third=str.substr(7, str.length)
  449. if (!this.searchNumber) {
  450. return '<span class="active2">' + first + '</span>' + second +
  451. '<span class="active2">' + third + '</span>'
  452. // return '<span class="active">' + str.substr(0, 3) + '</span>' + str.substr(3, 4) +
  453. // '<span class="active">' + str.substr(7, str.length) + '</span>'
  454. // if (this.searchNumber!= ["1", "", "", "", "", "", "", "", "", "", ""].toString()) {
  455. // let arrStr = ''
  456. // let strArr = str.split('');
  457. // let list = this.searchNumber
  458. // strArr.forEach((item, index) => {
  459. // if (item == list[index] && index != 0) {
  460. // arrStr += '<span class="active">' + item + '</span>'
  461. // } else {
  462. // arrStr += item
  463. // }
  464. // })
  465. // return arrStr
  466. // } else {
  467. // }
  468. } else {
  469. return str.replace(new RegExp(this.searchNumber, 'g'), '<span class="active">' + this.searchNumber + '</span>')
  470. }
  471. // if (this.searchNumber) {
  472. // return str.replace(new RegExp(num, 'g'), '<span class="active">' + num + '</span>')
  473. // } else {
  474. // return '<span class="active1">' + str.substr(0, 3) + '</span>' + str.substr(3, 4) +
  475. // '<span class="active1">' + str.substr(7, str.length) + '</span>'
  476. // }
  477. },
  478. // 初始化列表
  479. phoneList() {
  480. this.boxList = []
  481. this.boxList1 = []
  482. this.current=null
  483. this.$http.searchList({'product_sku':this.showData.product_sku}).then(res => {
  484. if (res.data.code == 1) {
  485. let boxList = res.data.data
  486. boxList.forEach((item,index) => {
  487. if(this.searchNumber&&!this.searchChecked){
  488. if((item+'').indexOf(this.searchNumber)!=-1){
  489. this.boxList1.push(JSON.parse(JSON.stringify(item)))
  490. let item1='<div>' + this.numberType(item,index) + '</div>'
  491. this.boxList.push(item1)
  492. }else{
  493. return
  494. }
  495. }if(this.searchNumber&&this.searchChecked){
  496. // console.log((boxList+'').substr((boxList+'').substr(7, (boxList+'').length),this.searchNumber)
  497. if((item+'').substr(-this.searchNumber.length)==this.searchNumber){
  498. this.boxList1.push(JSON.parse(JSON.stringify(item)))
  499. item='<div>' + this.numberType(item,index) + '</div>'
  500. this.boxList.push(item)
  501. }
  502. }
  503. else{
  504. this.boxList1.push(JSON.parse(JSON.stringify(item)))
  505. item='<div>' + this.numberType(item,index) + '</div>'
  506. this.boxList.push(item)
  507. }
  508. // this.$set(item, 'phoneHtml', '<div>' + this.numberType(item) + '</div>')
  509. // if (item.hits) {
  510. // this.$set(item, 'phoneHtml', '<div>' + this.numberTypeHits(item.hits, item
  511. // .no) + '</div>')
  512. // } else {
  513. // this.$set(item, 'phoneHtml', '<div>' + this.numberType(item.no) + '</div>')
  514. // }
  515. })
  516. this.$nextTick(()=>{
  517. if(this.boxList.length==0){
  518. this.empty=true
  519. }else{
  520. this.empty=false
  521. }
  522. })
  523. }
  524. })
  525. },
  526. // 是否是尾号
  527. search_lastChange(e) {
  528. this.listData.search_last = e.value ? 1 : 0
  529. this.phoneList()
  530. },
  531. onConfirm(res) {
  532. console.log(res)
  533. this.form.county = res.value[2]
  534. this.countyName = res.result
  535. this.countyIndex = res.value
  536. },
  537. onCancel() {
  538. },
  539. // 区域内容
  540. area_tree() {
  541. this.$http.area_tree().then(res => {
  542. if (res.data.code === 1) {
  543. this.selector = res.data.data
  544. console.log(this.selector)
  545. this.loca()
  546. }
  547. });
  548. },
  549. // 号码详情界面
  550. showDetails(id) {
  551. this.$http.show({
  552. id: id
  553. })
  554. .then(res => {
  555. if (res.data.code == 1) {
  556. this.showData = res.data.data
  557. }
  558. })
  559. },
  560. // 获取本地经纬度
  561. loca() {
  562. let this_ = this;
  563. if (this.mixin_type != 'TOUTIAO' && this.mixin_type != 'H5') {
  564. ks.getSetting({
  565. success(res) {
  566. if (!res.authSetting['scope.userLocation']) {
  567. //提前向用户发起授权请求
  568. uni.getLocation({
  569. type: 'wgs84',
  570. success: function(res) {
  571. console.log('当前位置的经度:' + res.longitude);
  572. console.log('当前位置的纬度:' + res.latitude);
  573. this_.loAcquire(res.longitude, res.latitude)
  574. }
  575. });
  576. }
  577. },
  578. });
  579. } else if (this_.mixin_type == 'H5') {
  580. this_.jsonp('https://apis.map.qq.com/ws/location/v1/ip', {
  581. key: "O7NBZ-PTTCG-OEPQF-I6MTS-YEKCJ-OCFVO",
  582. output: "jsonp"
  583. })
  584. .then(res => {
  585. console.log(res.result.ad_info);
  586. let adInfo = res.result.ad_info
  587. this_.cityId(adInfo.province, adInfo.city, adInfo.district)
  588. })
  589. } else {
  590. uni.getLocation({
  591. type: 'wgs84',
  592. highAccuracyExpireTime: 100,
  593. success: function(res) {
  594. console.log('当前位置的经度:' + res.longitude);
  595. console.log('当前位置的纬度:' + res.latitude);
  596. this_.loAcquire(res.longitude, res.latitude)
  597. }
  598. });
  599. }
  600. },
  601. // 根据经纬度查询城市
  602. loAcquire(longitude, latitude) {
  603. let this_=this;
  604. http('https://restapi.amap.com/v3/geocode/regeo',"GET",{
  605. key: "08dceab59cbce678d07e89924e376f53",
  606. location: longitude + ',' + latitude,
  607. output: "JSON"
  608. })
  609. .then(res=>{
  610. console.log(res)
  611. if(res.statusCode == 200){
  612. if(res.data.status == 1){
  613. console.log({
  614. province:res.data.regeocode.addressComponent.province,
  615. city:res.data.regeocode.addressComponent.city,
  616. district:res.data.regeocode.addressComponent.district,
  617. });
  618. let province = res.data.regeocode.addressComponent.province;
  619. let city = res.data.regeocode.addressComponent.city;
  620. let district = res.data.regeocode.addressComponent.district;
  621. if(!isString(city)){
  622. city = province;
  623. }
  624. // uni.setStorage({
  625. // key: 'address',
  626. // data: JSON.stringify({
  627. // district:district,
  628. // city:city,
  629. // province:province,
  630. // })
  631. // });
  632. this_.cityId(province, city, district);
  633. }
  634. }
  635. })
  636. // let this_ = this;
  637. // this.myAmapFun.reverseGeocoder({
  638. // location: {
  639. // latitude: latitude,
  640. // longitude: longitude
  641. // },
  642. // success: function(res) {
  643. // console.log("解析地址成功");
  644. // console.log(res);
  645. // // 根据名称筛选id
  646. // this_.cityId(res.result.address_component.province, res.result.address_component.city,
  647. // res.result.address_component.district)
  648. // },
  649. // fail: function(res) {
  650. // uni.showToast({
  651. // title: '定位失败',
  652. // duration: 2000,
  653. // icon: "none"
  654. // })
  655. // console.log(res);
  656. // },
  657. // complete: function(res) {
  658. // console.log(res);
  659. // }
  660. // })
  661. },
  662. // 根据名称筛选id
  663. cityId(province, city, district) {
  664. this.selector.forEach((val, i) => {
  665. if (val.label.slice(0, 2) == province.slice(0, 2) || val.label == province) {
  666. console.log(val.label)
  667. console.log(val.value)
  668. val.children.forEach((item, l) => {
  669. if (item.label.slice(0, 2) == city.slice(0, 2) || item.label == city) {
  670. console.log(item.label)
  671. console.log(item.value)
  672. item.children.forEach((con, y) => {
  673. if (con.label.slice(0, 2) == district.slice(0, 2) || con
  674. .label == district) {
  675. console.log(con.label)
  676. console.log(con.value)
  677. this.countyIndex = [i, l, y]
  678. this.countyName = val.label + item.label + con.label
  679. this.form.county = con.value
  680. }
  681. })
  682. }
  683. })
  684. }
  685. })
  686. },
  687. // 城市选择id锁定
  688. confirm(e) {
  689. console.log(e)
  690. this.form.county = e[2].value
  691. this.countyName = e[0].label + e[1].label + e[2].label
  692. },
  693. //重新提交订单
  694. submitOrder(){
  695. //图片处理
  696. let files1 = [];
  697. let files2 = [];
  698. let files3 = [];
  699. // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
  700. files1 = this.$refs.uUpload1.lists.filter(val => {
  701. return val.progress == 100;
  702. })
  703. files2 = this.$refs.uUpload2.lists.filter(val => {
  704. return val.progress == 100;
  705. })
  706. files3 = this.$refs.uUpload3.lists.filter(val => {
  707. return val.progress == 100;
  708. })
  709. if(files1[0]==undefined){
  710. this.$refs.uToast.show({
  711. title: '请上传身份证正面照',
  712. type: 'error ',
  713. })
  714. return;
  715. }
  716. if(files2[0]==undefined){
  717. this.$refs.uToast.show({
  718. title: '请上传身份证背面照',
  719. type: 'error ',
  720. })
  721. return;
  722. }
  723. if(files3[0]==undefined){
  724. this.$refs.uToast.show({
  725. title: '请上传本人免冠正面照',
  726. type: 'error ',
  727. })
  728. return;
  729. }
  730. let form={}
  731. form.id=this.orderId
  732. form.idcard_face_img=files1[0].response.data.url
  733. form.idcard_back_img=files2[0].response.data.url
  734. form.face_img=files3[0].response.data.url
  735. this.$http.uploadIdentityFlow(form)
  736. .then(res => {
  737. console.log(121,res)
  738. if (res.data.code == 1) {
  739. this.$refs.uToast.show({
  740. title: res.data.msg,
  741. type: 'error ',
  742. })
  743. setTimeout(()=>{
  744. uni.navigateBack()
  745. },1000)
  746. } else {
  747. this.$refs.uToast.show({
  748. title: res.data.msg,
  749. type: 'error ',
  750. })
  751. }
  752. })
  753. },
  754. apply() {
  755. if(this.showData.card_status==1){
  756. //图片处理
  757. let files1 = [];
  758. let files2 = [];
  759. let files3 = [];
  760. // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
  761. files1 = this.$refs.uUpload1.lists.filter(val => {
  762. return val.progress == 100;
  763. })
  764. files2 = this.$refs.uUpload2.lists.filter(val => {
  765. return val.progress == 100;
  766. })
  767. files3 = this.$refs.uUpload3.lists.filter(val => {
  768. return val.progress == 100;
  769. })
  770. if(files1[0]==undefined){
  771. this.$refs.uToast.show({
  772. title: '请上传身份证正面照',
  773. type: 'error ',
  774. })
  775. return;
  776. }
  777. if(files2[0]==undefined){
  778. this.$refs.uToast.show({
  779. title: '请上传身份证背面照',
  780. type: 'error ',
  781. })
  782. return;
  783. }
  784. if(files3[0]==undefined){
  785. this.$refs.uToast.show({
  786. title: '请上传本人免冠正面照',
  787. type: 'error ',
  788. })
  789. return;
  790. }
  791. this.form.open_idcard_face_img=files1[0].response.data.url
  792. this.form.open_idcard_back_img=files2[0].response.data.url
  793. this.form.open_face_img=files3[0].response.data.url
  794. }
  795. if(this.current!=null){
  796. this.form.no=this.boxList1[this.current]
  797. }
  798. if (this.form.name == '') {
  799. this.$refs.uToast.show({
  800. title: '请输入姓名',
  801. type: 'error ',
  802. })
  803. return;
  804. }
  805. if (!this.$check.checkName(this.form.name)) {
  806. this.$refs.uToast.show({
  807. title: '请输入正确的格式',
  808. type: 'error ',
  809. })
  810. return;
  811. }
  812. if (this.form.phone == '') {
  813. this.$refs.uToast.show({
  814. title: '请输入手机号',
  815. type: 'error ',
  816. })
  817. return;
  818. }
  819. if (!this.$check.checkMobile(this.form.phone)) {
  820. this.$refs.uToast.show({
  821. title: '请输入正确手机号的格式',
  822. type: 'error ',
  823. })
  824. return;
  825. }
  826. if(this.form.sms_code=='' && this.configAll.system_sms_open){
  827. this.$refs.uToast.show({
  828. title: '请输入验证码',
  829. type: 'error ',
  830. })
  831. return;
  832. }
  833. if (this.form.id_no == '') {
  834. this.$refs.uToast.show({
  835. title: '请输入身份证号',
  836. type: 'error',
  837. })
  838. return;
  839. }
  840. if (!this.$check.IdName(this.form.id_no)) {
  841. this.$refs.uToast.show({
  842. title: '请输入正确的身份证',
  843. type: 'error',
  844. })
  845. return;
  846. }
  847. if (this.form.county == 0) {
  848. this.$refs.uToast.show({
  849. title: '请选择城市',
  850. type: 'error ',
  851. })
  852. return;
  853. }
  854. if (this.form.address == '') {
  855. this.$refs.uToast.show({
  856. title: '请输入地址',
  857. type: 'error ',
  858. })
  859. return;
  860. }
  861. this.applyType = false
  862. //#ifdef MP-TOUTIAO
  863. this.form.pay_type = 6
  864. this.form.platform_type = 'dy_mini'
  865. //#endif
  866. // 是否是H5支付
  867. if (this.mixin_type == 'H5') {
  868. this.form.pay_type = 2
  869. }
  870. //#ifdef H5
  871. const res = window.location.href;
  872. if (res.indexOf('?') === -1) return
  873. const URL = res.split('?')[1];
  874. let obj = {}; // 声明参数对象
  875. let arr = URL.split("&");
  876. for (let i = 0; i < arr.length; i++) {
  877. let arrNew = arr[i].split("=");
  878. obj[arrNew[0]] = arrNew[1];
  879. }
  880. this.form.return_url = 'https://mmlh.vip/build/#/'
  881. this.form.clickid = obj.clickid
  882. //#endif
  883. this.$http.apply(this.form)
  884. .then(res => {
  885. console.log(res)
  886. //#ifdef H5
  887. let this_ = this;
  888. _baq.track("form", {
  889. assets_id: this_.$assets_id,
  890. product_name: this_.showData.name,
  891. product_price: this_.showData.amount
  892. })
  893. //#endif
  894. if (res.data.code == 1) {
  895. if (res.data.data.without_pay == 0) {
  896. if (this.mixin_type == 'H5') {
  897. window.location.href = res.data.data.pay_url
  898. } else {
  899. this.pay(res.data.data)
  900. }
  901. } else {
  902. uni.navigateTo({
  903. url: '/pages/flowOrderDetails/flowOrderDetails?id=' + res.data.data.id,
  904. });
  905. }
  906. } else {
  907. this.$refs.uToast.show({
  908. title: res.data.msg,
  909. type: 'error ',
  910. })
  911. }
  912. })
  913. },
  914. //调用支付
  915. pay(val) {
  916. let this_ = this;
  917. uni.getProvider({
  918. service: 'oauth',
  919. success: function(res) {
  920. console.log(res.provider)
  921. console.log(this_.mixin_type + '来源')
  922. if (this_.mixin_type != 'TOUTIAO') {
  923. ks.pay({
  924. serviceId: '1',
  925. orderInfo: val.res,
  926. success(res) {
  927. console.log(res)
  928. // 支付成功
  929. this_.$refs.uToast.show({
  930. title: '支付成功',
  931. type: 'success ',
  932. })
  933. uni.navigateTo({
  934. url: '/pages/flowOrderDetails/flowOrderDetails?id=' +
  935. res.data.data.id,
  936. });
  937. },
  938. fail(e) {
  939. if (e.errMsg == 'pay:fail request payment cancel') {
  940. this_.$refs.uToast.show({
  941. title: '支付取消',
  942. type: 'error ',
  943. })
  944. } else {
  945. this_.$refs.uToast.show({
  946. title: '支付失败',
  947. type: 'error ',
  948. })
  949. }
  950. }
  951. })
  952. } else {
  953. // uni.requestPayment({
  954. // "provider": res.provider[0],
  955. // "orderInfo": val.res,
  956. // "service": 5,
  957. // getOrderStatus: res => new Promise((resolve, reject) => {
  958. // console.log(res)
  959. // resolve(res)
  960. // }),
  961. // success(res) {
  962. // console.log(res)
  963. // // 支付成功
  964. // if (res.code == 0) {
  965. // this_.$refs.uToast.show({
  966. // title: '支付成功',
  967. // type: 'success ',
  968. // })
  969. // uni.navigateTo({
  970. // url: '/pages/flowOrderDetails/flowOrderDetails?id=' +
  971. // res.data.data.id,
  972. // });
  973. // } else if (res.code == 4) {
  974. // this_.$refs.uToast.show({
  975. // title: '支付取消',
  976. // type: 'error ',
  977. // })
  978. // } else if (res.code == 1) {
  979. // this_.$refs.uToast.show({
  980. // title: '支付超时',
  981. // type: 'error ',
  982. // })
  983. // } else if (res.code == 2) {
  984. // this_.$refs.uToast.show({
  985. // title: '支付失败',
  986. // type: 'error ',
  987. // })
  988. // } else if (res.code == 3) {
  989. // this_.$refs.uToast.show({
  990. // title: '支付关闭 ',
  991. // type: 'error ',
  992. // })
  993. // } else {
  994. // }
  995. // },
  996. // fail(e) {
  997. // console.log(e)
  998. // }
  999. // })
  1000. tt.requestOrder({
  1001. data: val.data,
  1002. byteAuthorization: val.byteAuthorization,
  1003. success({ orderId }) {
  1004. tt.getOrderPayment({
  1005. orderId,
  1006. success(res) {
  1007. this_.$refs.uToast.show({
  1008. title: "支付成功",
  1009. type: "success ",
  1010. });
  1011. uni.navigateTo({
  1012. url: "/pages/flowOrderDetails/flowOrderDetails?id=" + val.id,
  1013. });
  1014. },
  1015. fail(err) {
  1016. console.log(err, "err");
  1017. if (err.errMsg == "pay:fail request payment cancel") {
  1018. this_.$refs.uToast.show({
  1019. title: "支付取消",
  1020. type: "error ",
  1021. });
  1022. } else {
  1023. this_.$refs.uToast.show({
  1024. title: "支付失败",
  1025. type: "error ",
  1026. });
  1027. }
  1028. },
  1029. });
  1030. },
  1031. });
  1032. }
  1033. }
  1034. });
  1035. },
  1036. }
  1037. }
  1038. </script>
  1039. <style lang="scss">
  1040. .tab{
  1041. background-color: rgb(213, 46, 76);
  1042. color: rgb(255, 255, 255);
  1043. height: 44px;
  1044. line-height: 44px;
  1045. display: flex;
  1046. justify-content: space-between;
  1047. padding: 0 3px;
  1048. font-size: 16px;
  1049. font-weight: bold;
  1050. }
  1051. .sendSMS{
  1052. position: relative;
  1053. width: 100%;
  1054. .sms{
  1055. position: absolute;
  1056. right: 0;
  1057. top: 50%;
  1058. transform: translateY(-50%);
  1059. z-index: 11;
  1060. }
  1061. }
  1062. .sms{
  1063. /deep/ .tips{
  1064. width: 168rpx;
  1065. height: 49rpx;
  1066. text-align: center;
  1067. line-height: 49rpx;
  1068. // border: 1rpx solid #D52E4C;
  1069. border-radius: 20rpx;
  1070. font-size: 26rpx;
  1071. color: #fff;
  1072. background-color: $uni-color-BGC;
  1073. margin-top: 4rpx;
  1074. }
  1075. /deep/ input{
  1076. flex: 1;
  1077. }
  1078. }
  1079. .upload {
  1080. position: relative;
  1081. left: 50%;
  1082. transform: translateX(-50%);
  1083. padding: 30rpx;
  1084. margin-bottom: 30rpx;
  1085. border: 3rpx dashed #d52e4c;
  1086. border-radius: 10rpx;
  1087. image {
  1088. width: 220rpx;
  1089. height: 140rpx;
  1090. border-radius: 10rpx;
  1091. }
  1092. //平均分配
  1093. .flexJu{
  1094. display: flex;
  1095. justify-content: space-between;
  1096. }
  1097. .ding {
  1098. position: absolute;
  1099. width: 60rpx;
  1100. height: 50rpx;
  1101. right: 110rpx;
  1102. top: 70rpx;
  1103. }
  1104. .u-upload {
  1105. width: 220rpx;
  1106. height: 140rpx;
  1107. border-radius: 10rpx;
  1108. background-color: #f1cfd5;
  1109. }
  1110. /deep/ .u-list-item {
  1111. margin: 0;
  1112. height: 140rpx !important;
  1113. }
  1114. /deep/ .u-add-wrap {
  1115. opacity: 0;
  1116. }
  1117. }
  1118. page {
  1119. height: 100%;
  1120. }
  1121. .card {
  1122. padding: 30rpx 40rpx 180rpx;
  1123. width: 635rpx;
  1124. background: rgba(255, 255, 255, 0.2);
  1125. border: 2px dashed #D52E4C;
  1126. border-radius: 20rpx;
  1127. margin-bottom: 20rpx;
  1128. overflow: hidden;
  1129. .cardImg {
  1130. image {
  1131. width: 237rpx;
  1132. height: 138rpx;
  1133. }
  1134. }
  1135. .cardTitle {
  1136. font-size: 32rpx;
  1137. color: #333333;
  1138. font-weight: bold;
  1139. margin: 35rpx 0 20rpx;
  1140. }
  1141. .intro {
  1142. font-size: 20rpx;
  1143. line-height: 30rpx;
  1144. color: #BBBBBB;
  1145. }
  1146. }
  1147. .popup {
  1148. position: fixed;
  1149. bottom: 0;
  1150. left: 0;
  1151. right: 0;
  1152. height: 1000rpx;
  1153. position: relative;
  1154. width: 100%;
  1155. max-width: 400px;
  1156. box-sizing: border-box;
  1157. padding: 37rpx 60rpx 69rpx;
  1158. .btn {
  1159. position: absolute;
  1160. bottom: 40rpx;
  1161. width: 630rpx;
  1162. height: 77rpx;
  1163. line-height: 77rpx;
  1164. background: #D52E4C;
  1165. border-radius: 39rpx;
  1166. margin: 20rpx auto;
  1167. text-align: center;
  1168. color: #fff;
  1169. font-size: 32rpx;
  1170. }
  1171. .last {
  1172. image {
  1173. margin-right: 11rpx;
  1174. width: 28rpx;
  1175. height: 28rpx;
  1176. }
  1177. font-size: 24rpx;
  1178. color: #2FA4FF;
  1179. margin: 20rpx auto 20rpx;
  1180. }
  1181. .search {
  1182. .inputBox {
  1183. box-sizing: border-box;
  1184. padding-left: 40rpx;
  1185. width: 480rpx;
  1186. height: 74rpx;
  1187. background: #F1F1F1;
  1188. border-radius: 37rpx;
  1189. input {
  1190. border: none;
  1191. }
  1192. .searchIcon {
  1193. width: 140rpx;
  1194. height: 74rpx;
  1195. background: #D0352D;
  1196. border-radius: 37rpx;
  1197. line-height: 74rpx;
  1198. text-align: center;
  1199. image {
  1200. width: 37rpx;
  1201. height: 37rpx;
  1202. vertical-align: middle;
  1203. }
  1204. }
  1205. }
  1206. }
  1207. .numberList {
  1208. flex-wrap: wrap;
  1209. margin-top: 23rpx;
  1210. max-height: 640rpx;
  1211. overflow: auto;
  1212. .numberItem {
  1213. font-weight: bold;
  1214. margin-bottom: 15rpx;
  1215. line-height: 79rpx;
  1216. text-align: center;
  1217. width: 283rpx;
  1218. height: 79rpx;
  1219. background: #FFFFFF;
  1220. border: 1px solid #E2E2E2;
  1221. border-radius: 12rpx;
  1222. /deep/ .active {
  1223. color: $uni-color-BGC;
  1224. }
  1225. /deep/ .active1 {
  1226. margin: 0 5px;
  1227. }
  1228. /deep/ .active2 {
  1229. color: $uni-color-BGC;
  1230. margin: 0 5px;
  1231. }
  1232. }
  1233. .selectItem {
  1234. color:#fff;
  1235. // border: 2px solid #D52E4C;
  1236. background-color: #D52E4C;
  1237. /deep/ .active {
  1238. color:#fff;
  1239. }
  1240. /deep/ .active2 {
  1241. color:#fff;
  1242. }
  1243. // background: #FBEAED;
  1244. }
  1245. }
  1246. }
  1247. .selectphone {
  1248. line-height: 102rpx;
  1249. padding: 0 52rpx;
  1250. margin: 26rpx auto 0;
  1251. width: 701rpx;
  1252. height: 102rpx;
  1253. border: 2px solid #E6028D;
  1254. border-radius: 24rpx;
  1255. text {
  1256. font-size: 25rpx;
  1257. color: #333333;
  1258. }
  1259. .selectText {
  1260. color: #BBBBBB;
  1261. margin-right: 30rpx;
  1262. }
  1263. .selectText1 {
  1264. color: #333;
  1265. margin-right: 30rpx;
  1266. }
  1267. }
  1268. .flowDetails {
  1269. // height: 100%;
  1270. overflow: hidden;
  1271. .img {
  1272. width: 100%;
  1273. display: flex;
  1274. flex-direction: column;
  1275. image {
  1276. width: 100%;
  1277. }
  1278. uni-image {
  1279. display: block;
  1280. }
  1281. }
  1282. .form {
  1283. width: 703rpx;
  1284. box-sizing: border-box;
  1285. padding: 30rpx;
  1286. position: relative;
  1287. margin: 20rpx auto 30rpx;
  1288. background-color: #fff;
  1289. border: 4rpx solid #E6028D;
  1290. border-radius: 30rpx;
  1291. .btn {
  1292. width: 569rpx;
  1293. height: 77rpx;
  1294. line-height: 77rpx;
  1295. background: #D52E4C;
  1296. border-radius: 39rpx;
  1297. margin: 20rpx auto;
  1298. text-align: center;
  1299. color: #fff;
  1300. font-size: 32rpx;
  1301. }
  1302. .orderTit {
  1303. text {
  1304. margin-left: 30rpx;
  1305. color: dimgray;
  1306. }
  1307. }
  1308. .formInput {
  1309. .u-form-item {
  1310. /deep/ .u-form-item--left__content__label {
  1311. position: relative;
  1312. padding-left: 30rpx;
  1313. }
  1314. /deep/.u-form-item--left__content__label::after {
  1315. content: '*';
  1316. position: absolute;
  1317. left: 18rpx;
  1318. top: 0;
  1319. color: red;
  1320. }
  1321. }
  1322. .remark {
  1323. /deep/.u-form-item--left__content__label::after {
  1324. display: none;
  1325. }
  1326. }
  1327. }
  1328. }
  1329. }
  1330. </style>