user.vue 27 KB

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