user.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376
  1. <template>
  2. <view class="container">
  3. <view style="position: absolute;padding-left: 80%; display: flex;">
  4. <image @click='smBtnClick' style='width:21px;height:21px;' src="../../static/img/saoma.png"></image>
  5. <image @click='setting' style='width:21px;height:21px;margin-left: 20rpx;'
  6. src="../../static/img/sign/shezhi@3x.png"></image>
  7. </view>
  8. <view class="indexUp flex justify-between">
  9. <view class='flex'>
  10. <image v-bind:src="headUrl" class="headPortrait"></image>
  11. <view class="personal">
  12. <view @click="toLogin" class="information">{{hasLogin? username : '立即登录' }}</view>
  13. <view style='font-size:13px;color:#8F97AB;' class="information">{{hasLogin?starUserphone:''}}</view>
  14. <view v-if="haveCompany">
  15. <view v-if='hasLogin' @click='show=true' class="company">
  16. <image class='icon' style='width:19px;height:19px;' src="../../static/img/icon_qiye@3x.png"
  17. mode=""></image> {{compName}}>
  18. </view>
  19. <u-picker @confirm='compconfirm' mode="selector" v-model="show" :range="companyList"
  20. range-key="compName"></u-picker>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. <view style='background:transparent;margin-bottom:0;padding:0;' class="cu-list grid"
  26. :class="['col-' + gridCol,gridBorder?'':'no-border']">
  27. <view class="cu-item" v-for="(item,index) in gridList" :key="index" @click="gridClick(item, index)"
  28. v-if="index<gridCol*2">
  29. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  30. <image :src="item.src" class="sign"></image>
  31. <text style="color: #333333;">{{item.name}}</text>
  32. </view>
  33. </view>
  34. </view>
  35. <view v-if="hasLogin" class="cover-container">
  36. <view class='cover-container-item'>
  37. <view style='font-size:16px;padding-left:14px;'>我的功能</view>
  38. <view class="cu-list grid" :class="['col-' + gridCol,gridBorder?'':'no-border']">
  39. <view class="cu-item" style='text-align:center;' v-for="(item,index) in gridList1" :key="index"
  40. @click="gridClick(item, index)" v-show="item.show">
  41. <view :class="['cuIcon-' + item.cuIcon,'text-' + item.color]">
  42. <text v-if='item.num==3&&taskTip&&taskTip<100' class='badge_user'>{{taskTip}}</text>
  43. <text v-if='item.num==3&&taskTip&&taskTip>100' class='badge_user'>...</text>
  44. <image :src="item.src" class="sign1"></image>
  45. </view>
  46. <text style="color: #333333;">{{item.name}}</text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
  52. :content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
  53. showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
  54. </view>
  55. <!-- <view style="margin-top: 10rpx;">
  56. <web-view src="https://datav.aliyuncs.com/share/01de6913a5761ab4d3171b1f0b3e0704"></web-view>
  57. </view> -->
  58. <!-- <view style='text-align:center;'>
  59. <navigator
  60. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
  61. class="path" hover-class="navigator-hover">《服务协议》</navigator>
  62. <navigator
  63. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
  64. class="path" hover-class="navigator-hover">《隐私政策》</navigator>
  65. </view> -->
  66. <!-- <view class="guess-section-wrap">
  67. <view class='flex justify-between'>
  68. <view class='title Medium'>工厂价格</view>
  69. </view>
  70. <view class=' guess-section-wrap-item clearfix' v-for='(item,index1) in plantList' :key="index1">
  71. <view class='factory'>{{item.factory}}</view>
  72. <view class='wrap'>{{item.city}} {{item.factoryType}}</view>
  73. <view class='price'>
  74. <text class='currectprice '>{{item.price}}</text>
  75. 较昨日
  76. <image v-if='item.comparePrice>0' style="width:7.5px;height:9px;"
  77. src='../../static/img/homepage/shangsheng.png'></image>
  78. <image v-if='item.comparePrice<0' style="width:7.5px;height:9px;"
  79. src='../../static/img/homepage/xiajiang.png'></image>
  80. <text v-if='item.comparePrice>0' class='yesterday up'>{{item.comparePrice}}</text>
  81. <text v-if='item.comparePrice<0' class='yesterday down'>{{-item.comparePrice}}</text>
  82. <text v-if='item.comparePrice==0' class='yesterday'>-</text>
  83. </view>
  84. </view>
  85. </view>
  86. <u-back-top :scroll-top="scrollTop" mode="circle" icon="arrow-upward"></u-back-top> -->
  87. </view>
  88. </template>
  89. <script>
  90. import helper from '@/common/helper.js';
  91. import dragButton from "@/components/drag-button/drag-button.vue";
  92. import {
  93. mapState
  94. } from 'vuex';
  95. let startY = 0,
  96. moveY = 0,
  97. pageAtTop = true;
  98. export default {
  99. components: {
  100. dragButton
  101. },
  102. data() {
  103. return {
  104. isShowAlert: false,
  105. content: '您尚未登录,是否立即登录?',
  106. haveCompany: false,
  107. scrollTop: 0,
  108. inputShow: false,
  109. modalName: '',
  110. compName: '',
  111. mycarStyle: '',
  112. show: false,
  113. feild: undefined,
  114. inputContent: '',
  115. coverTransform: 'translateY(0px)',
  116. coverTransition: '0s',
  117. moving: false,
  118. footprintList: [],
  119. isVip: false,
  120. userInfoTmp: [],
  121. inputStatus: 'none',
  122. carInfo: [],
  123. plantList: [],
  124. headUrl: "../../static/img/myimg/YongHu@3x.png",
  125. userphone: "",
  126. gridCol: 4,
  127. gridBorder: false,
  128. username: "请更改昵称",
  129. companyList: [],
  130. gridList: [{
  131. num: 0,
  132. name: '认证',
  133. // icon: 'cuIcon-apps',
  134. src: '../../static/img/myimg/renzheng@3x.png',
  135. tips: 0,
  136. url: '/pages/attestation/index',
  137. show: true
  138. },
  139. {
  140. num: 1,
  141. name: '粮脉',
  142. // icon: 'cuIcon-apps',
  143. src: '../../static/img/myimg/liangmai@3x.png',
  144. tips: 0,
  145. url: '/pages/grain_pulse/my_grain_pulse',
  146. show: true
  147. },
  148. {
  149. num: 2,
  150. name: '发布',
  151. // icon: 'cuIcon-news',
  152. src: '../../static/img/myimg/fabu@3x.png',
  153. tips: 0,
  154. url: `/pages/release/release`,
  155. show: true
  156. },
  157. {
  158. num: 3,
  159. name: '货运收发',
  160. // icon: 'cuIcon-copy',
  161. src: '../../static/img/sign/receiveGoods@2x.png',
  162. tips: 0,
  163. url: `/pageA/freightTransport/index`,
  164. show: true
  165. },
  166. ],
  167. gridList1: [
  168. // {
  169. // num: 2,
  170. // name: '我的票据',
  171. // // icon: 'cuIcon-news',
  172. // src: '../../static/img/sign/piaoju@3x.png',
  173. // tips: 0,
  174. // url: `/pages/bill/index`,
  175. // show: true
  176. // },
  177. // {
  178. // num: 3,
  179. // name: '我的合同',
  180. // // icon: 'cuIcon-calendar',
  181. // src: '../../static/img/sign/myContract@2x.png',
  182. // tips: 0,
  183. // url: '/pageB/contract/contract',
  184. // show: true
  185. // },
  186. // {
  187. // num: 4,
  188. // name: '我的任务',
  189. // // icon: 'cuIcon-copy',
  190. // src: '../../static/img/sign/myTask@2x.png',
  191. // tips: 0,
  192. // url: '/pages/task/my_task',
  193. // show: true
  194. // },
  195. // {
  196. // num: 5,
  197. // name: '联系客服',
  198. // // icon: 'cuIcon-edit',
  199. // src: '../../static/img/sign/service.png',
  200. // tips: 0,
  201. // url: `/pages/erp/contactCustomerService/contactCustomerService`,
  202. // show: true
  203. // },
  204. // {
  205. // num: 6,
  206. // name: '数据报表',
  207. // // icon: 'cuIcon-edit',
  208. // src: '../../static/img/sign/shujubaobiao@2x.png',
  209. // tips: 0,
  210. // url: `/pages/user/report`,
  211. // show: false
  212. // },
  213. // {
  214. // num: 7,
  215. // name: '库点监控',
  216. // // icon: 'cuIcon-edit',
  217. // src: '../../static/img/sign/kudianjiankong@2x.png',
  218. // tips: 0,
  219. // url: `/pages/user/depotMonitoring`,
  220. // show: false
  221. // },
  222. // {
  223. // num: 8,
  224. // name: '库点收购',
  225. // // icon: 'cuIcon-edit',
  226. // src: '../../static/img/sign/kdsg.png',
  227. // tips: 0,
  228. // url: `/pages/user/depotAcquisition/depotAcquisition`,
  229. // show: true
  230. // },
  231. // {
  232. // num: 2,
  233. // name: '我的合同',
  234. // // icon: 'cuIcon-calendar',
  235. // src: '../../static/img/sign/myContract@2x.png',
  236. // tips: 0,
  237. // url: '/pageB/contract/contract',
  238. // show: true
  239. // },
  240. {
  241. num: 0,
  242. name: 'ERP业务',
  243. // icon: 'cuIcon-copy',
  244. src: '../../static/img/myimg/erp.png',
  245. tips: 0,
  246. url: `/pages/erp/index`,
  247. show: uni.getStorageSync('pcUserInfo')?true:false
  248. },
  249. {
  250. num: 1,
  251. // name: '入库管理',
  252. name: '收购业务',
  253. // icon: 'cuIcon-copy',
  254. src: '../../static/img/myimg/sg.png',
  255. tips: 0,
  256. url: `/pages/erpbusiness/index`,
  257. show: uni.getStorageSync('pcUserInfo')?true:false
  258. },
  259. {
  260. num: 2,
  261. name: '我的票据',
  262. // icon: 'cuIcon-news',
  263. src: '../../static/img/sign/piaoju@3x.png',
  264. tips: 0,
  265. url: `/pages/bill/index`,
  266. show: true
  267. },
  268. {
  269. num: 3,
  270. name: '我的任务',
  271. // icon: 'cuIcon-copy',
  272. src: '../../static/img/sign/myTask@2x.png',
  273. tips: 0,
  274. url: '/pages/task/my_task',
  275. show: uni.getStorageSync('pcUserInfo')?true:false
  276. },
  277. {
  278. num: 4,
  279. name: '联系客服',
  280. // icon: 'cuIcon-edit',
  281. src: '../../static/img/sign/service.png',
  282. tips: 0,
  283. url: `/pages/erp/contactCustomerService/contactCustomerService`,
  284. show: true
  285. },
  286. {
  287. num: 5,
  288. name: '库点收购',
  289. // icon: 'cuIcon-edit',
  290. src: '../../static/img/sign/kdsg.png',
  291. tips: 0,
  292. url: `/pages/user/depotAcquisition/depotAcquisition`,
  293. show: true
  294. },
  295. {
  296. num: 6,
  297. name: '数据报表',
  298. // icon: 'cuIcon-edit',
  299. src: '../../static/img/sign/shujubaobiao@2x.png',
  300. tips: 0,
  301. url: `/pages/user/report`,
  302. show: uni.getStorageSync('pcUserInfo')?true:false
  303. },
  304. {
  305. num: 7,
  306. name: '库点监控',
  307. // icon: 'cuIcon-edit',
  308. src: '../../static/img/sign/kudianjiankong@2x.png',
  309. tips: 0,
  310. url: `/pages/user/depotMonitoring`,
  311. show: uni.getStorageSync('pcUserInfo')?true:false
  312. },
  313. {
  314. num: 8,
  315. name: 'OA办公',
  316. // icon: 'cuIcon-edit',
  317. src: '../../static/img/oa_office/oaOffice.png',
  318. tips: 0,
  319. url: `/pages/oa_office/the_oaOffice`,
  320. show: uni.getStorageSync('pcUserInfo')?true:false
  321. },
  322. // {
  323. // num: 9,
  324. // name: '打卡',
  325. // // icon: 'cuIcon-edit',
  326. // src: '../../static/img/sign/daka.png',
  327. // tips: 0,
  328. // url: `/pages/clock/the_clock`,
  329. // show: true
  330. // },
  331. // {
  332. // num: 10,
  333. // name: '请假',
  334. // // icon: 'cuIcon-edit',
  335. // src: '../../static/img/sign/qingjia.png',
  336. // tips: 0,
  337. // url: `/pages/leave/the_leave`,
  338. // show: true
  339. // },
  340. // {
  341. // num: 11,
  342. // name: '加油',
  343. // // icon: 'cuIcon-edit',
  344. // src: '../../static/img/sign/jiayou.png',
  345. // tips: 0,
  346. // url: `/pages/fuelfilling/the_fuel_filling`,
  347. // show: true
  348. // },
  349. // {
  350. // num: 10,
  351. // name: '短途记录',
  352. // // icon: 'cuIcon-edit',
  353. // src: '../../static/img/sign/dt.png',
  354. // tips: 0,
  355. // url: `/pages/shortDistance/short_distance_record`,
  356. // show: true
  357. // }
  358. ],
  359. showTran: true,
  360. companyId: 1,
  361. current: 4
  362. }
  363. },
  364. // #ifndef MP
  365. onNavigationBarButtonTap(e) {
  366. const index = e.index;
  367. if (index === 0) {
  368. this.navTo('/pages/set/set');
  369. } else if (index === 1) {
  370. // #ifdef APP-PLUS
  371. const pages = getCurrentPages();
  372. const page = pages[pages.length - 1];
  373. const currentWebview = page.$getAppWebview();
  374. currentWebview.hideTitleNViewButtonRedDot({
  375. index
  376. });
  377. // #endif
  378. uni.navigateTo({
  379. url: '/pages/notice/notice'
  380. })
  381. }
  382. },
  383. // #endif
  384. computed: {
  385. ...mapState(['hasLogin', 'userInfo']),
  386. // 手机号中间4位加*
  387. starUserphone() {
  388. let reg = /^(\d{3})\d{4}(\d{4})$/;
  389. if (this.userphone) {
  390. return this.userphone.replace(reg, "$1****$2");
  391. }
  392. }
  393. },
  394. onPageScroll(e) {
  395. this.scrollTop = e.scrollTop;
  396. },
  397. onShow() {
  398. // console.log(111111111)
  399. if(uni.getStorageSync('pcUserInfo')){
  400. // console.log(2222222)
  401. for (var i = 0; i < this.gridList1.length; i++) {
  402. if(this.gridList1[i].num==0||this.gridList1[i].num==1||this.gridList1[i].num==3||this.gridList1[i].num==6||this.gridList1[i].num==7||this.gridList1[i].num==8){
  403. this.gridList1[i].show=true
  404. }
  405. }
  406. }else{
  407. // console.log(33333333)
  408. for (var i = 0; i < this.gridList1.length; i++) {
  409. if(this.gridList1[i].num==0||this.gridList1[i].num==1||this.gridList1[i].num==3||this.gridList1[i].num==6||this.gridList1[i].num==7||this.gridList1[i].num==8){
  410. this.gridList1[i].show=false
  411. }
  412. }
  413. }
  414. // console.log("uni.getStorageSync('compName1')")
  415. // console.log(uni.getStorageSync("compName1"))
  416. // if (uni.getStorageSync("compName1")) {
  417. // this.haveCompany = true
  418. // } else {
  419. // this.haveCompany = false
  420. // }
  421. this.isShow();
  422. uni.hideKeyboard()
  423. uni.showTabBar()
  424. uni.removeTabBarBadge({
  425. index: 4
  426. })
  427. this.loadData()
  428. console.log("hasLogin", this.hasLogin)
  429. var that = this
  430. if (this.userInfo) {
  431. if (!this.userInfo.avatarUrl) {
  432. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  433. } else {
  434. this.headUrl = this.userInfo.avatarUrl
  435. }
  436. this.username = this.userInfo.userName ? this.userInfo.userName : uni.getStorageSync("userInfo").data
  437. .userName
  438. this.userphone = this.userInfo.phone ? this.userInfo.phone : uni.getStorageSync("userInfo").data.phone
  439. this.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
  440. console.log("noticeNumber", res)
  441. if (res.data.data) {
  442. let name = 'myTip';
  443. let value = res.data.data.total;
  444. that.$store.commit('$uStore', {
  445. name,
  446. value
  447. });
  448. if (value != 0 && value) {
  449. uni.setTabBarBadge({
  450. index: 4,
  451. text: value + ""
  452. })
  453. }
  454. name = 'taskTip';
  455. value = res.data.data.total;
  456. that.$store.commit('$uStore', {
  457. name,
  458. value
  459. });
  460. // name = 'contractTip';
  461. // value = res.data.data.contractTip;
  462. // that.$store.commit('$uStore', {
  463. // name,
  464. // value
  465. // });
  466. }
  467. })
  468. console.log("this.1111")
  469. uni.getStorage({
  470. key: 'compName1',
  471. success: function (res) {
  472. console.log("this.2222")
  473. console.log(res.data);
  474. if(res.data){
  475. that.compName = res.data
  476. that.haveCompany = true
  477. }
  478. },
  479. fail() {
  480. that.$api.doRequest('get', '/commonUser/getCompOwn', {
  481. phone: that.userInfo.phone
  482. }).then(res => {
  483. if (res.data.data) {
  484. that.companyList = res.data.data
  485. console.log("that.3333")
  486. console.log(that.companyList)
  487. if (that.companyList.length > 0) {
  488. that.compName = that.companyList[0].compName
  489. console.log("this.compName")
  490. console.log(that.compName)
  491. uni.setStorageSync('compName1', that.companyList[0].compName)
  492. that.haveCompany = true
  493. }
  494. else{
  495. that.haveCompany = false
  496. }
  497. }
  498. })
  499. }
  500. });
  501. } else {
  502. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  503. this.username = "立即登录"
  504. }
  505. console.log("this.userInfo", this.userInfo)
  506. },
  507. methods: {
  508. alertBtn() {
  509. uni.navigateTo({
  510. url: '/pages/public/login'
  511. })
  512. },
  513. cancelClick() {
  514. this.isShowAlert = false
  515. },
  516. compconfirm(e) {
  517. var that = this
  518. this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
  519. mobilePhone: this.userInfo.phone,
  520. companyName: this.companyList[e[0]].compName,
  521. veriCode: "123456",
  522. }).then(res1 => {
  523. if (res1.data.code == 200) {
  524. uni.setStorageSync('pcUserInfo', res1.data.data)
  525. uni.setStorageSync('compName1', that.companyList[e[0]].compName)
  526. that.compName = that.companyList[e[0]].compName
  527. helper.getListByUserId()
  528. that.$api.msg('切换成功')
  529. } else {
  530. that.$api.doRequest('post', '/commonUser/api/loginQuickly', {
  531. mobilePhone: '14444444444',
  532. companyName: this.companyList[e[0]].compName,
  533. veriCode: "123456",
  534. }).then(res2 => {
  535. uni.setStorageSync('pcUserInfo', res2.data.data)
  536. uni.setStorageSync('compName1', that.companyList[e[0]].compName)
  537. that.compName = that.companyList[e[0]].compName
  538. helper.getListByUserId()
  539. that.$api.msg('切换成功')
  540. })
  541. }
  542. })
  543. },
  544. getRoles: function(role) {
  545. let _roles = uni.getStorageSync('rolesList')
  546. for (let i = 0; i < _roles.length; i++) {
  547. if (_roles[i] == role) {
  548. return true
  549. }
  550. }
  551. return false
  552. },
  553. isShow() {
  554. for (let k = 0; k < this.gridList1.length; k++) {
  555. if (k == 6) {
  556. this.gridList1[k].show = this.getRoles('reportData.view')
  557. } else if (k == 7) {
  558. this.gridList1[k].show = this.getRoles('monitoring.view')
  559. }
  560. }
  561. },
  562. smBtnClick() {
  563. if (!this.hasLogin) {
  564. this.isShowAlert = true;
  565. // uni.showModal({
  566. // title: '提示',
  567. // content: '您尚未登录,是否立即登录?',
  568. // showCancel: true,
  569. // confirmText: '登录',
  570. // success: (e) => {
  571. // if (e.confirm) {
  572. // uni.navigateTo({
  573. // url: '/pages/public/login'
  574. // })
  575. // }
  576. // },
  577. // fail: () => {},
  578. // complete: () => {}
  579. // })
  580. } else {
  581. uni.scanCode({
  582. success: function(res) {
  583. console.log('条码内容:' + res.result);
  584. uni.navigateTo({
  585. url: "/pages/erpbusiness/sm/sm?data=" + res.result
  586. })
  587. }
  588. });
  589. }
  590. },
  591. fankui() {
  592. uni.navigateTo({
  593. url: `/pages/user/fankui`
  594. })
  595. },
  596. zhibo() {
  597. uni.navigateTo({
  598. url: `/pageB/video/broadcast`
  599. })
  600. },
  601. look() {
  602. uni.navigateTo({
  603. url: `/pageB/video/look`
  604. })
  605. },
  606. contactUs() {
  607. const that = this
  608. uni.makePhoneCall({
  609. // 手机号
  610. phoneNumber: '18241771147',
  611. // 成功回调
  612. success: (res) => {},
  613. // 失败回调
  614. fail: (res) => {}
  615. });
  616. },
  617. loadData() {
  618. // 工厂价格
  619. // let that = this
  620. // that.$api.request('news', 'getFactoryPriceInfo', {
  621. // category: this.category,
  622. // page: 1,
  623. // limit: 99999
  624. // }, failres => {
  625. // that.$api.msg(failres.errmsg)
  626. // this.isLoadMore = false
  627. // this.loadStatus = 'nomore'
  628. // if (this.pages > 1) {
  629. // this.pages = 1
  630. // }
  631. // uni.hideLoading()
  632. // }).then(res => {
  633. // let data = res.data
  634. // that.plantList = data
  635. // // that.makeScrollData(that.plantList, 8)
  636. // uni.hideLoading()
  637. // })
  638. // const that = this
  639. // if(uni.getStorageSync("PageCur")){
  640. // that.PageCur = uni.getStorageSync("PageCur");
  641. // }
  642. // that.userInfoTmp = uni.getStorageSync("userInfo")
  643. // uni.showLoading({
  644. // title: '正在加载',
  645. // mask:true
  646. // })
  647. // that.$api.request('integral', 'getIndexData', failres => {
  648. // that.$api.msg(failres.errmsg)
  649. // uni.hideLoading()
  650. // }).then(res => {
  651. // let data = res.data
  652. // uni.setStorageSync("message", data.message);
  653. // uni.setStorageSync("task", data.task);
  654. // uni.setStorageSync("contract", data.contract);
  655. // uni.setStorageSync('showTran', data.showTran);
  656. // that.showTran = data.showTran
  657. // that.gridList[4].tips = data.task
  658. // that.gridList[2].tips = data.contract
  659. // that.companyId = data.companyId
  660. // uni.hideLoading()
  661. // })
  662. },
  663. gridClick(item, index) {
  664. var that = this
  665. if (item.name == "退出登录") {
  666. this.logout()
  667. return;
  668. } else if (item.name == "联系我们") {
  669. //#ifdef MP
  670. this.inputShow = true
  671. this.inputStatus = 'inline'
  672. this.feild = "nickname"
  673. this.inputContent = ''
  674. //#endif
  675. //#ifdef APP-PLUS
  676. this.contactUs()
  677. //#endif
  678. return;
  679. } else if (item.name == '我的车辆') {
  680. const that = this
  681. uni.showLoading({
  682. title: '正在加载',
  683. mask: true
  684. })
  685. that.$api.request('tran', 'getMyCarList', failres => {
  686. that.$api.msg(failres.errmsg)
  687. uni.hideLoading()
  688. }).then(res => {
  689. that.carInfo = res.data
  690. if (that.carInfo.length == 0) {
  691. that.$api.msg('暂无车辆信息')
  692. } else {
  693. var height = that.carInfo.length * 100
  694. var width = 500
  695. that.mycarStyle = "height:" + height + "rpx;width:" + width + "rpx"
  696. that.modalName = 'MycarModal'
  697. }
  698. uni.hideLoading()
  699. })
  700. return;
  701. }
  702. if (!this.hasLogin) {
  703. this.isShowAlert = true;
  704. // uni.showModal({
  705. // title: '提示',
  706. // content: '您尚未登录,是否立即登录?',
  707. // showCancel: true,
  708. // confirmText: '登录',
  709. // success: (e) => {
  710. // if (e.confirm) {
  711. // uni.navigateTo({
  712. // url: '/pages/public/login'
  713. // })
  714. // }
  715. // },
  716. // fail: () => {},
  717. // complete: () => {}
  718. // })
  719. } else {
  720. if (item.url) {
  721. uni.navigateTo({
  722. url: item.url + `?companyId=${that.companyId}`
  723. })
  724. }
  725. }
  726. },
  727. setting() {
  728. if (!this.hasLogin) {
  729. this.isShowAlert = true;
  730. // uni.showModal({
  731. // title: '提示',
  732. // content: '您尚未登录,是否立即登录?',
  733. // showCancel: true,
  734. // confirmText: '登录',
  735. // success: (e) => {
  736. // if (e.confirm) {
  737. // uni.navigateTo({
  738. // url: '/pages/public/login'
  739. // })
  740. // }
  741. // },
  742. // fail: () => {},
  743. // complete: () => {}
  744. // })
  745. } else {
  746. uni.navigateTo({
  747. url: '/pages/user/setUp'
  748. })
  749. }
  750. },
  751. toLogin() {
  752. console.log("userInfo", this.userInfo)
  753. if (!this.hasLogin || !this.userInfo || this.username == "立即登录") {
  754. uni.navigateTo({
  755. url: '/pages/public/login_account_number'
  756. })
  757. } else {
  758. uni.navigateTo({
  759. url: '/pages/user/setUp'
  760. })
  761. }
  762. // else if(!this.userInfo.nickname){
  763. // this.inputShow = true
  764. // this.inputStatus = 'inline'
  765. // this.feild = "nickname"
  766. // this.inputContent = ''
  767. // }
  768. },
  769. confirm() {
  770. const that = this
  771. if (!that.inputContent) {
  772. that.$api.msg('输入不能为空')
  773. return
  774. }
  775. let obj = {}
  776. obj[that.feild] = that.inputContent
  777. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  778. that.userInfo.nickname = that.inputContent
  779. that.inputContent = ''
  780. that.$store.commit('login', that.userInfo)
  781. })
  782. },
  783. cancel() {
  784. this.inputShow = false
  785. this.inputStatus = 'none'
  786. this.genderShow = false
  787. },
  788. myAccount() {
  789. uni.navigateTo({
  790. url: `/pageA/pages/contract`
  791. })
  792. },
  793. logout() {
  794. // const that = this
  795. this.isShowAlert = true
  796. // uni.showModal({
  797. // title: '询问',
  798. // content: '您确定要退出吗?',
  799. // cancelText: '取消',
  800. // confirmText: '确定',
  801. // success: (e) => {
  802. // if (e.confirm) {
  803. // uni.hideTabBarRedDot({
  804. // index: 3
  805. // })
  806. // uni.clearStorageSync();
  807. // that.$store.commit('logout')
  808. // that.$api.logout()
  809. // uni.navigateTo({
  810. // url: `/pages/public/login`
  811. // })
  812. // }
  813. // }
  814. // })
  815. },
  816. /**
  817. * 统一跳转接口,拦截未登录路由
  818. * navigator标签现在默认没有转场动画,所以用view
  819. */
  820. navTo(url) {
  821. if (!this.hasLogin) {
  822. url = '/pages/public/login';
  823. }
  824. uni.navigateTo({
  825. url
  826. })
  827. },
  828. mycarClick(carNo) {
  829. this.modalName = null
  830. uni.navigateTo({
  831. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  832. })
  833. },
  834. qrClick(userInfo) {
  835. this.modalName = null
  836. uni.navigateTo({
  837. url: `/pages/user/qr`
  838. })
  839. },
  840. scanCode() {
  841. uni.scanCode({
  842. success: function(res) {
  843. uni.navigateTo({
  844. url: res.result
  845. })
  846. }
  847. })
  848. },
  849. hideModal(e) {
  850. this.modalName = null
  851. },
  852. }
  853. }
  854. </script>
  855. <style lang='scss' scoped>
  856. .company {
  857. position: fixed;
  858. right: 0;
  859. top: 10%;
  860. background: url('../../static/img/qiyebeijing.png');
  861. background-size: 100%;
  862. font-size: 11px;
  863. padding-bottom: 5px;
  864. padding-left: 10px;
  865. border-radius: 40rpx 0 0 40rpx;
  866. }
  867. .company .icon {
  868. position: relative;
  869. top: 4px;
  870. }
  871. page {
  872. background: #F8F9FC;
  873. }
  874. .container {
  875. padding-top: 85px;
  876. padding-top: 35px;
  877. background-color: #F5F6FA;
  878. position: relative;
  879. width: 100vw;
  880. overflow: hidden;
  881. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  882. background-size: 100% 100%;
  883. margin: 0 auto;
  884. height: calc(100vh - 0px);
  885. }
  886. .cu-tag.badge {
  887. right: 26rpx;
  888. }
  889. .path {
  890. color: #007aff;
  891. display: inline-block;
  892. text-align: center;
  893. }
  894. .icon {
  895. margin-right: 10rpx;
  896. }
  897. .portrait-box {
  898. margin-top: 20rpx;
  899. }
  900. .qr-wrap {
  901. margin-top: 20upx;
  902. color: #fff;
  903. font-size: 32rpx;
  904. }
  905. .cu-list {
  906. /* height: 483rpx;
  907. overflow-y: scroll; */
  908. margin-top: 16rpx;
  909. margin-bottom: 80rpx;
  910. }
  911. .cu-list.grid>.cu-item .badge_user {
  912. color: #fff;
  913. display: flex;
  914. justify-content: center;
  915. align-items: center;
  916. border: 1px solid #fff;
  917. background-color: #f43530;
  918. padding: 4px;
  919. position: absolute;
  920. font-size: 12px;
  921. font-weight: 700;
  922. width: 22px;
  923. height: 22px;
  924. right: 19px;
  925. top: -12px;
  926. z-index: 2;
  927. border-radius: 50%;
  928. }
  929. @keyframes move_wave {
  930. 0% {
  931. transform: translateX(0) translateZ(0) scaleY(1)
  932. }
  933. 50% {
  934. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  935. }
  936. 100% {
  937. transform: translateX(-50%) translateZ(0) scaleY(1)
  938. }
  939. }
  940. .bg {
  941. position: relative;
  942. height: 300rpx;
  943. /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
  944. /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
  945. background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
  946. }
  947. .bg_ware {
  948. position: absolute;
  949. left: 0;
  950. bottom: -2rpx;
  951. width: 100%;
  952. mix-blend-mode: screen;
  953. height: 224rpx;
  954. }
  955. %flex-center {
  956. display: flex;
  957. flex-direction: column;
  958. justify-content: center;
  959. align-items: center;
  960. }
  961. %section {
  962. display: flex;
  963. justify-content: space-around;
  964. align-content: center;
  965. background: #fff;
  966. border-radius: 10upx;
  967. }
  968. .grid-item-box {
  969. flex: 1;
  970. /* position: relative;
  971. */
  972. /* #ifndef APP-NVUE */
  973. display: flex;
  974. /* #endif */
  975. flex-direction: column;
  976. align-items: center;
  977. justify-content: center;
  978. padding: 15px 0;
  979. }
  980. .user-section {
  981. height: 520upx;
  982. padding: 100upx 30upx 0;
  983. position: relative;
  984. .bg {
  985. position: absolute;
  986. left: 0;
  987. top: 0;
  988. width: 100%;
  989. height: 100%;
  990. filter: blur(1px);
  991. box-shadow: 0px 1px 8px #ccc;
  992. /* background:linear-gradient(#0eb0c9,#126bae); */
  993. /* opacity: .7; */
  994. }
  995. }
  996. .user-info-box {
  997. height: 180upx;
  998. /* display:flex; */
  999. /* align-items:center; */
  1000. text-align: center;
  1001. position: relative;
  1002. z-index: 1;
  1003. .portrait {
  1004. width: 130upx;
  1005. height: 130upx;
  1006. border: 5upx solid #fff;
  1007. border-radius: 50%;
  1008. }
  1009. .username {
  1010. font-size: $font-lg + 3upx;
  1011. color: #fff;
  1012. margin-top: 20upx;
  1013. }
  1014. }
  1015. .vip-card-box {
  1016. display: flex;
  1017. flex-direction: column;
  1018. color: #f7d680;
  1019. height: 240upx;
  1020. background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
  1021. border-radius: 16upx 16upx 0 0;
  1022. overflow: hidden;
  1023. position: relative;
  1024. padding: 20upx 24upx;
  1025. .card-bg {
  1026. position: absolute;
  1027. top: 20upx;
  1028. right: 0;
  1029. width: 380upx;
  1030. height: 260upx;
  1031. }
  1032. .b-btn {
  1033. position: absolute;
  1034. right: 20upx;
  1035. top: 16upx;
  1036. width: 132upx;
  1037. height: 40upx;
  1038. text-align: center;
  1039. line-height: 40upx;
  1040. font-size: 22upx;
  1041. color: #36343c;
  1042. border-radius: 20px;
  1043. background: linear-gradient(left, #f9e6af, #ffd465);
  1044. z-index: 1;
  1045. }
  1046. .tit {
  1047. font-size: $font-base+2upx;
  1048. color: #f7d680;
  1049. margin-bottom: 28upx;
  1050. .yticon {
  1051. color: #f6e5a3;
  1052. margin-right: 16upx;
  1053. }
  1054. }
  1055. .e-b {
  1056. font-size: $font-sm;
  1057. color: #d8cba9;
  1058. margin-top: 10upx;
  1059. }
  1060. }
  1061. .cover-container {
  1062. padding: 1px 10px;
  1063. padding-bottom: 20rpx;
  1064. /* background-color: #F5F6FA; */
  1065. /* border-radius: 20px; */
  1066. margin-top: 12upx;
  1067. .arc {
  1068. position: absolute;
  1069. left: 0;
  1070. top: -34upx;
  1071. width: 100%;
  1072. height: 36upx;
  1073. }
  1074. }
  1075. .tj-sction {
  1076. @extend %section;
  1077. .tj-item {
  1078. @extend %flex-center;
  1079. flex-direction: column;
  1080. height: 140upx;
  1081. font-size: $font-sm;
  1082. color: #75787d;
  1083. }
  1084. .num {
  1085. font-size: $font-lg;
  1086. color: $font-color-dark;
  1087. margin-bottom: 8upx;
  1088. }
  1089. }
  1090. .order-section {
  1091. @extend %section;
  1092. padding: 28upx 0;
  1093. margin-top: 20upx;
  1094. .order-item {
  1095. @extend %flex-center;
  1096. width: 120upx;
  1097. height: 120upx;
  1098. border-radius: 10upx;
  1099. font-size: $font-sm;
  1100. color: $font-color-dark;
  1101. }
  1102. .yticon {
  1103. font-size: 48upx;
  1104. margin-bottom: 18upx;
  1105. color: #fa436a;
  1106. }
  1107. .icon-shouhoutuikuan {
  1108. font-size: 44upx;
  1109. }
  1110. }
  1111. .history-section {
  1112. padding: 30upx 0 0;
  1113. margin-top: 20upx;
  1114. background: #fff;
  1115. border-radius: 10upx;
  1116. .sec-header {
  1117. display: flex;
  1118. align-items: center;
  1119. font-size: $font-base;
  1120. color: $font-color-dark;
  1121. line-height: 40upx;
  1122. margin-left: 30upx;
  1123. .yticon {
  1124. font-size: 44upx;
  1125. color: #5eba8f;
  1126. margin-right: 16upx;
  1127. line-height: 40upx;
  1128. }
  1129. }
  1130. .h-list {
  1131. white-space: nowrap;
  1132. padding: 30upx 30upx 0;
  1133. image {
  1134. display: inline-block;
  1135. width: 160upx;
  1136. height: 160upx;
  1137. margin-right: 20upx;
  1138. border-radius: 10upx;
  1139. }
  1140. }
  1141. }
  1142. .grid {
  1143. display: flex;
  1144. align-items: center;
  1145. flex-wrap: wrap;
  1146. /* border-top: 2upx solid rgba(172,172,172,.2); */
  1147. .grid-item-3 {
  1148. box-sizing: border-box;
  1149. width: calc(100% / 3);
  1150. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  1151. border-right: 2upx solid rgba(172, 172, 172, .2);
  1152. text-align: center;
  1153. padding: 40upx 0;
  1154. position: relative;
  1155. /* view{
  1156. font-size: $font-sm;
  1157. margin-top: 16upx;
  1158. color: $font-color-dark;
  1159. } */
  1160. .grid_icon {
  1161. font-size: 48upx;
  1162. margin-bottom: 18upx;
  1163. color: #fa436a;
  1164. }
  1165. .tip_text {
  1166. display: block;
  1167. padding: 4upx 8upx;
  1168. text-align: center;
  1169. border-radius: 36upx;
  1170. font-size: 24upx;
  1171. background-color: #fa436a;
  1172. color: rgba(255, 255, 255, 1);
  1173. position: absolute;
  1174. right: 6upx;
  1175. top: 6upx;
  1176. }
  1177. }
  1178. .grid-item-3:nth-child(3n + 3),
  1179. .grid-item-4:nth-child(4n + 4) {
  1180. border-right: none;
  1181. }
  1182. }
  1183. .headPortrait {
  1184. width: 112rpx;
  1185. height: 112rpx;
  1186. border-radius: 40px;
  1187. border: 2px solid #ffffff;
  1188. }
  1189. .personal {
  1190. margin-top: 10px;
  1191. margin-left: 10px;
  1192. }
  1193. .information {
  1194. font-size: 15px;
  1195. font-weight: 600;
  1196. height: 60rpx;
  1197. }
  1198. .indexlow {
  1199. /* margin-top: 30px; */
  1200. border-radius: 10px;
  1201. }
  1202. .cu-list>.cu-item:after {
  1203. border: none;
  1204. }
  1205. .sign {
  1206. width: 35px;
  1207. height: 35px;
  1208. top: 4px;
  1209. }
  1210. .sign1 {
  1211. width: 26px;
  1212. height: 26px;
  1213. top: 4px;
  1214. }
  1215. .indexUp {
  1216. padding: 0 20px;
  1217. align-items: center;
  1218. }
  1219. .cu-list.grid>.cu-item .cu-tag.badge {
  1220. color: #fff;
  1221. background: #FF6600;
  1222. font-size: 9px;
  1223. line-height: 5px;
  1224. padding: 5px;
  1225. }
  1226. .cover-container-item {
  1227. background: #fff;
  1228. border-radius: 10px;
  1229. padding: 10px 0;
  1230. }
  1231. .cover-container-item .cu-list {
  1232. margin: 0;
  1233. }
  1234. .cover-container-item .cu-list.grid>.cu-item [class*=cuIcon] {
  1235. margin: 0;
  1236. }
  1237. .guess-section-wrap-item {
  1238. float: left;
  1239. width: 38vw;
  1240. background: #F9F9FA;
  1241. padding: 7px;
  1242. margin: 20rpx;
  1243. border-radius: 3px;
  1244. // width:50%;
  1245. }
  1246. .guess-section-wrap-item:first-child {
  1247. // margin-left:2px;
  1248. }
  1249. .clearfix:after {
  1250. content: "";
  1251. display: block;
  1252. clear: both;
  1253. }
  1254. .guess-section-wrap {
  1255. padding: 15px;
  1256. margin: 10rpx 20rpx;
  1257. border-radius: 5px;
  1258. background: #fff;
  1259. overflow: hidden;
  1260. }
  1261. .guess-section-wrap .price {
  1262. color: #B2B3BB;
  1263. display: flex;
  1264. align-items: center;
  1265. }
  1266. .title {
  1267. font-size: 28upx;
  1268. color: $font-color-dark;
  1269. font-weight: bold;
  1270. height: 50upx;
  1271. line-height: 50upx;
  1272. flex: 2.5;
  1273. }
  1274. .factory {
  1275. font-size: 26rpx;
  1276. font-weight: 900;
  1277. }
  1278. .currectprice {
  1279. color: rgba(253, 113, 79, 1);
  1280. font-size: 18px;
  1281. font-weight: 550;
  1282. vertical-align: middle;
  1283. margin-right: 10px;
  1284. }
  1285. .yesterday {
  1286. font-size: 14px;
  1287. font-weight: 600;
  1288. vertical-align: middle;
  1289. }
  1290. .yesterday.up {
  1291. color: rgba(253, 113, 79, 1);
  1292. }
  1293. .yesterday.down {
  1294. color: #22C572;
  1295. }
  1296. </style>