user.vue 27 KB

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