user.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  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. this.loadData()
  283. console.log("hasLogin", this.hasLogin)
  284. if (this.userInfo) {
  285. if (!this.userInfo.avatarUrl) {
  286. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  287. } else {
  288. this.headUrl = this.userInfo.avatarUrl
  289. }
  290. this.username = this.userInfo.userName
  291. this.userphone = this.userInfo.phone
  292. var that = this
  293. this.$api.doRequest('get', '/notice/query/noticeNumber').then(res => {
  294. console.log("noticeNumber", res)
  295. if (res.data.data) {
  296. let name = 'myTip';
  297. let value = res.data.data.task;
  298. that.$store.commit('$uStore', {
  299. name,
  300. value
  301. });
  302. if (value != 0 && value) {
  303. uni.setTabBarBadge({
  304. index: 4,
  305. text: value + ""
  306. })
  307. }
  308. name = 'taskTip';
  309. value = res.data.data.task;
  310. that.$store.commit('$uStore', {
  311. name,
  312. value
  313. });
  314. // name = 'contractTip';
  315. // value = res.data.data.contractTip;
  316. // that.$store.commit('$uStore', {
  317. // name,
  318. // value
  319. // });
  320. }
  321. })
  322. // debugger
  323. if(!uni.getStorageSync('compName')){
  324. this.$api.doRequest('get', '/commonUser/getCompOwn', {
  325. phone: this.userInfo.phone
  326. }).then(res => {
  327. if (res.data.data) {
  328. this.companyList=res.data.data
  329. if(this.companyList.length>0){
  330. this.compName=this.companyList[0].compName
  331. uni.setStorageSync('compName', this.companyList[0].compName)
  332. this.haveCompany = true
  333. }
  334. }
  335. })
  336. }else{
  337. this.compName=uni.getStorageSync('compName')
  338. }
  339. } else {
  340. this.headUrl = "../../static/img/myimg/YongHu@3x.png"
  341. this.username = "立即登录"
  342. }
  343. console.log("this.userInfo", this.userInfo)
  344. },
  345. methods: {
  346. cancelClick() {
  347. this.isShowAlert = false
  348. },
  349. goOpenService() {
  350. uni.hideTabBarRedDot({
  351. index: 3
  352. })
  353. uni.clearStorageSync();
  354. this.$store.commit('logout')
  355. this.$api.logout()
  356. uni.navigateTo({
  357. url: `/pages/public/login`
  358. })
  359. },
  360. compconfirm(e){
  361. var that = this
  362. this.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: this.userInfo.phone,companyName:this.companyList[e[0]].compName,
  363. veriCode: "123456",}).then(res1 => {
  364. if(res1.data.code==200){
  365. uni.setStorageSync('pcUserInfo', res1.data.data)
  366. uni.setStorageSync('compName', that.companyList[e[0]].compName)
  367. that.compName=that.companyList[e[0]].compName
  368. helper.getListByUserId()
  369. that.$api.msg('切换成功')
  370. }
  371. else{
  372. that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '13333333333',companyName:this.companyList[e[0]].compName,
  373. veriCode: "123456",}).then(res2 => {
  374. uni.setStorageSync('pcUserInfo', res2.data.data)
  375. uni.setStorageSync('compName', that.companyList[e[0]].compName)
  376. that.compName=that.companyList[e[0]].compName
  377. helper.getListByUserId()
  378. that.$api.msg('切换成功')
  379. })
  380. }
  381. })
  382. },
  383. getRoles: function(role) {
  384. let _roles = uni.getStorageSync('rolesList')
  385. for (let i = 0; i < _roles.length; i++) {
  386. if (_roles[i] == role) {
  387. return true
  388. }
  389. }
  390. return false
  391. },
  392. isShow(){
  393. for(let k = 0;k<this.gridList1.length;k++){
  394. if(k==6){
  395. this.gridList1[k].show = this.getRoles('reportData.view')
  396. }else if (k==7){
  397. this.gridList1[k].show = this.getRoles('monitoring.view')
  398. }
  399. }
  400. },
  401. smBtnClick() {
  402. console.log(2)
  403. if (!this.hasLogin) {
  404. uni.showModal({
  405. title: '登录提示',
  406. content: '您尚未登录,是否立即登录?',
  407. showCancel: true,
  408. confirmText: '登录',
  409. success: (e) => {
  410. if (e.confirm) {
  411. uni.navigateTo({
  412. url: '/pages/public/login'
  413. })
  414. }
  415. },
  416. fail: () => {},
  417. complete: () => {}
  418. })
  419. } else {
  420. uni.scanCode({
  421. success: function(res) {
  422. console.log('条码内容:' + res.result);
  423. uni.navigateTo({
  424. url: "/pages/erpbusiness/sm/sm?data=" + res.result
  425. })
  426. }
  427. });
  428. }
  429. },
  430. fankui() {
  431. uni.navigateTo({
  432. url: `/pages/user/fankui`
  433. })
  434. },
  435. zhibo() {
  436. uni.navigateTo({
  437. url: `/pageB/video/broadcast`
  438. })
  439. },
  440. look() {
  441. uni.navigateTo({
  442. url: `/pageB/video/look`
  443. })
  444. },
  445. contactUs() {
  446. const that = this
  447. uni.makePhoneCall({
  448. // 手机号
  449. phoneNumber: '18241771147',
  450. // 成功回调
  451. success: (res) => {},
  452. // 失败回调
  453. fail: (res) => {}
  454. });
  455. },
  456. loadData() {
  457. // 工厂价格
  458. let that = this
  459. that.$api.request('news', 'getFactoryPriceInfo', {
  460. category: this.category,
  461. page: 1,
  462. limit: 99999
  463. }, failres => {
  464. that.$api.msg(failres.errmsg)
  465. this.isLoadMore = false
  466. this.loadStatus = 'nomore'
  467. if (this.pages > 1) {
  468. this.pages = 1
  469. }
  470. uni.hideLoading()
  471. }).then(res => {
  472. let data = res.data
  473. that.plantList = data
  474. // that.makeScrollData(that.plantList, 8)
  475. uni.hideLoading()
  476. })
  477. // const that = this
  478. // if(uni.getStorageSync("PageCur")){
  479. // that.PageCur = uni.getStorageSync("PageCur");
  480. // }
  481. // that.userInfoTmp = uni.getStorageSync("userInfo")
  482. // uni.showLoading({
  483. // title: '正在加载',
  484. // mask:true
  485. // })
  486. // that.$api.request('integral', 'getIndexData', failres => {
  487. // that.$api.msg(failres.errmsg)
  488. // uni.hideLoading()
  489. // }).then(res => {
  490. // let data = res.data
  491. // uni.setStorageSync("message", data.message);
  492. // uni.setStorageSync("task", data.task);
  493. // uni.setStorageSync("contract", data.contract);
  494. // uni.setStorageSync('showTran', data.showTran);
  495. // that.showTran = data.showTran
  496. // that.gridList[4].tips = data.task
  497. // that.gridList[2].tips = data.contract
  498. // that.companyId = data.companyId
  499. // uni.hideLoading()
  500. // })
  501. },
  502. gridClick(item, index) {
  503. var that = this
  504. if (item.name == "退出登录") {
  505. this.logout()
  506. return;
  507. } else if (item.name == "联系我们") {
  508. //#ifdef MP
  509. this.inputShow = true
  510. this.inputStatus = 'inline'
  511. this.feild = "nickname"
  512. this.inputContent = ''
  513. //#endif
  514. //#ifdef APP-PLUS
  515. this.contactUs()
  516. //#endif
  517. return;
  518. } else if (item.name == '我的车辆') {
  519. const that = this
  520. uni.showLoading({
  521. title: '正在加载',
  522. mask: true
  523. })
  524. that.$api.request('tran', 'getMyCarList', failres => {
  525. that.$api.msg(failres.errmsg)
  526. uni.hideLoading()
  527. }).then(res => {
  528. that.carInfo = res.data
  529. if (that.carInfo.length == 0) {
  530. that.$api.msg('暂无车辆信息')
  531. } else {
  532. var height = that.carInfo.length * 100
  533. var width = 500
  534. that.mycarStyle = "height:" + height + "rpx;width:" + width + "rpx"
  535. that.modalName = 'MycarModal'
  536. }
  537. uni.hideLoading()
  538. })
  539. return;
  540. }
  541. if (!this.hasLogin) {
  542. uni.showModal({
  543. title: '登录提示',
  544. content: '您尚未登录,是否立即登录?',
  545. showCancel: true,
  546. confirmText: '登录',
  547. success: (e) => {
  548. if (e.confirm) {
  549. uni.navigateTo({
  550. url: '/pages/public/login'
  551. })
  552. }
  553. },
  554. fail: () => {},
  555. complete: () => {}
  556. })
  557. } else {
  558. if (item.url) {
  559. uni.navigateTo({
  560. url: item.url + `?companyId=${that.companyId}`
  561. })
  562. }
  563. }
  564. },
  565. setting() {
  566. if (!this.hasLogin) {
  567. uni.showModal({
  568. title: '登录提示',
  569. content: '您尚未登录,是否立即登录?',
  570. showCancel: true,
  571. confirmText: '登录',
  572. success: (e) => {
  573. if (e.confirm) {
  574. uni.navigateTo({
  575. url: '/pages/public/login'
  576. })
  577. }
  578. },
  579. fail: () => {},
  580. complete: () => {}
  581. })
  582. } else {
  583. uni.navigateTo({
  584. url: '/pages/user/setUp'
  585. })
  586. }
  587. },
  588. toLogin() {
  589. console.log("userInfo", this.userInfo)
  590. if (!this.hasLogin || !this.userInfo || this.username == "立即登录") {
  591. uni.navigateTo({
  592. url: '/pages/public/login_account_number'
  593. })
  594. } else {
  595. uni.navigateTo({
  596. url: '/pages/user/setUp'
  597. })
  598. }
  599. // else if(!this.userInfo.nickname){
  600. // this.inputShow = true
  601. // this.inputStatus = 'inline'
  602. // this.feild = "nickname"
  603. // this.inputContent = ''
  604. // }
  605. },
  606. confirm() {
  607. const that = this
  608. if (!that.inputContent) {
  609. that.$api.msg('输入不能为空')
  610. return
  611. }
  612. let obj = {}
  613. obj[that.feild] = that.inputContent
  614. that.$api.request('user', 'syncUserInfo', obj).then(res => {
  615. that.userInfo.nickname = that.inputContent
  616. that.inputContent = ''
  617. that.$store.commit('login', that.userInfo)
  618. })
  619. },
  620. cancel() {
  621. this.inputShow = false
  622. this.inputStatus = 'none'
  623. this.genderShow = false
  624. },
  625. myAccount() {
  626. uni.navigateTo({
  627. url: `/pageA/pages/contract`
  628. })
  629. },
  630. logout() {
  631. // const that = this
  632. this.isShowAlert = true
  633. // uni.showModal({
  634. // title: '询问',
  635. // content: '您确定要退出吗?',
  636. // cancelText: '取消',
  637. // confirmText: '确定',
  638. // success: (e) => {
  639. // if (e.confirm) {
  640. // uni.hideTabBarRedDot({
  641. // index: 3
  642. // })
  643. // uni.clearStorageSync();
  644. // that.$store.commit('logout')
  645. // that.$api.logout()
  646. // uni.navigateTo({
  647. // url: `/pages/public/login`
  648. // })
  649. // }
  650. // }
  651. // })
  652. },
  653. /**
  654. * 统一跳转接口,拦截未登录路由
  655. * navigator标签现在默认没有转场动画,所以用view
  656. */
  657. navTo(url) {
  658. if (!this.hasLogin) {
  659. url = '/pages/public/login';
  660. }
  661. uni.navigateTo({
  662. url
  663. })
  664. },
  665. mycarClick(carNo) {
  666. this.modalName = null
  667. uni.navigateTo({
  668. url: `/pageB/car/mycar_detail?carNo=${carNo}`
  669. })
  670. },
  671. qrClick(userInfo) {
  672. this.modalName = null
  673. uni.navigateTo({
  674. url: `/pages/user/qr`
  675. })
  676. },
  677. scanCode() {
  678. uni.scanCode({
  679. success: function(res) {
  680. uni.navigateTo({
  681. url: res.result
  682. })
  683. }
  684. })
  685. },
  686. hideModal(e) {
  687. this.modalName = null
  688. },
  689. }
  690. }
  691. </script>
  692. <style lang='scss' scoped>
  693. .company{
  694. position:fixed;
  695. right:0;
  696. top:13%;
  697. background:url('../../static/img/qiyebeijing.png');
  698. background-size:100%;
  699. font-size:11px;
  700. padding-bottom:5px;
  701. padding-left:10px;
  702. }
  703. .company .icon{
  704. position:relative;
  705. top:4px;
  706. }
  707. page {
  708. background: #F8F9FC;
  709. }
  710. .container {
  711. padding-top: 85px;
  712. padding-top: 35px;
  713. background-color: #F5F6FA;
  714. position: relative;
  715. width: 100vw;
  716. overflow: hidden;
  717. background: url('~@/static/img/login/bg_slices/bg@3x.png');
  718. background-size: 100% 100%;
  719. margin: 0 auto;
  720. }
  721. .cu-tag.badge {
  722. right: 26rpx;
  723. }
  724. .path {
  725. color: #007aff;
  726. display: inline-block;
  727. text-align: center;
  728. }
  729. .icon {
  730. margin-right: 10rpx;
  731. }
  732. .portrait-box {
  733. margin-top: 20rpx;
  734. }
  735. .qr-wrap {
  736. margin-top: 20upx;
  737. color: #fff;
  738. font-size: 32rpx;
  739. }
  740. .cu-list {
  741. /* height: 483rpx;
  742. overflow-y: scroll; */
  743. margin-top: 16rpx;
  744. margin-bottom: 80rpx;
  745. }
  746. .cu-list.grid>.cu-item .badge_user {
  747. color: #fff;
  748. border: 1px solid #fff;
  749. background-color: #FF6600;
  750. display: inline-block;
  751. padding: .25em .25em;
  752. position: absolute;
  753. font-size: 9px;
  754. font-weight: 700;
  755. line-height: 1;
  756. text-align: center;
  757. white-space: nowrap;
  758. vertical-align: top;
  759. right: 26px;
  760. top: -10px;
  761. z-index: 2;
  762. border-radius: 50%;
  763. transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
  764. }
  765. @keyframes move_wave {
  766. 0% {
  767. transform: translateX(0) translateZ(0) scaleY(1)
  768. }
  769. 50% {
  770. transform: translateX(-25%) translateZ(0) scaleY(0.55)
  771. }
  772. 100% {
  773. transform: translateX(-50%) translateZ(0) scaleY(1)
  774. }
  775. }
  776. .bg {
  777. position: relative;
  778. height: 300rpx;
  779. /* background: linear-gradient(to bottom, #56ccf2, #2f80ed); */
  780. /*background: linear-gradient(to bottom, #0be9fe, #4bb0fe); */
  781. background: linear-gradient(to bottom, #d5f8ff, #56ccf2);
  782. }
  783. .bg_ware {
  784. position: absolute;
  785. left: 0;
  786. bottom: -2rpx;
  787. width: 100%;
  788. mix-blend-mode: screen;
  789. height: 224rpx;
  790. }
  791. %flex-center {
  792. display: flex;
  793. flex-direction: column;
  794. justify-content: center;
  795. align-items: center;
  796. }
  797. %section {
  798. display: flex;
  799. justify-content: space-around;
  800. align-content: center;
  801. background: #fff;
  802. border-radius: 10upx;
  803. }
  804. .grid-item-box {
  805. flex: 1;
  806. /* position: relative;
  807. */
  808. /* #ifndef APP-NVUE */
  809. display: flex;
  810. /* #endif */
  811. flex-direction: column;
  812. align-items: center;
  813. justify-content: center;
  814. padding: 15px 0;
  815. }
  816. .user-section {
  817. height: 520upx;
  818. padding: 100upx 30upx 0;
  819. position: relative;
  820. .bg {
  821. position: absolute;
  822. left: 0;
  823. top: 0;
  824. width: 100%;
  825. height: 100%;
  826. filter: blur(1px);
  827. box-shadow: 0px 1px 8px #ccc;
  828. /* background:linear-gradient(#0eb0c9,#126bae); */
  829. /* opacity: .7; */
  830. }
  831. }
  832. .user-info-box {
  833. height: 180upx;
  834. /* display:flex; */
  835. /* align-items:center; */
  836. text-align: center;
  837. position: relative;
  838. z-index: 1;
  839. .portrait {
  840. width: 130upx;
  841. height: 130upx;
  842. border: 5upx solid #fff;
  843. border-radius: 50%;
  844. }
  845. .username {
  846. font-size: $font-lg + 3upx;
  847. color: #fff;
  848. margin-top: 20upx;
  849. }
  850. }
  851. .vip-card-box {
  852. display: flex;
  853. flex-direction: column;
  854. color: #f7d680;
  855. height: 240upx;
  856. background: linear-gradient(left, rgba(0, 0, 0, .7), rgba(0, 0, 0, .8));
  857. border-radius: 16upx 16upx 0 0;
  858. overflow: hidden;
  859. position: relative;
  860. padding: 20upx 24upx;
  861. .card-bg {
  862. position: absolute;
  863. top: 20upx;
  864. right: 0;
  865. width: 380upx;
  866. height: 260upx;
  867. }
  868. .b-btn {
  869. position: absolute;
  870. right: 20upx;
  871. top: 16upx;
  872. width: 132upx;
  873. height: 40upx;
  874. text-align: center;
  875. line-height: 40upx;
  876. font-size: 22upx;
  877. color: #36343c;
  878. border-radius: 20px;
  879. background: linear-gradient(left, #f9e6af, #ffd465);
  880. z-index: 1;
  881. }
  882. .tit {
  883. font-size: $font-base+2upx;
  884. color: #f7d680;
  885. margin-bottom: 28upx;
  886. .yticon {
  887. color: #f6e5a3;
  888. margin-right: 16upx;
  889. }
  890. }
  891. .e-b {
  892. font-size: $font-sm;
  893. color: #d8cba9;
  894. margin-top: 10upx;
  895. }
  896. }
  897. .cover-container {
  898. padding: 1px 10px;
  899. padding-bottom: 20rpx;
  900. /* background-color: #F5F6FA; */
  901. /* border-radius: 20px; */
  902. margin-top: 12upx;
  903. .arc {
  904. position: absolute;
  905. left: 0;
  906. top: -34upx;
  907. width: 100%;
  908. height: 36upx;
  909. }
  910. }
  911. .tj-sction {
  912. @extend %section;
  913. .tj-item {
  914. @extend %flex-center;
  915. flex-direction: column;
  916. height: 140upx;
  917. font-size: $font-sm;
  918. color: #75787d;
  919. }
  920. .num {
  921. font-size: $font-lg;
  922. color: $font-color-dark;
  923. margin-bottom: 8upx;
  924. }
  925. }
  926. .order-section {
  927. @extend %section;
  928. padding: 28upx 0;
  929. margin-top: 20upx;
  930. .order-item {
  931. @extend %flex-center;
  932. width: 120upx;
  933. height: 120upx;
  934. border-radius: 10upx;
  935. font-size: $font-sm;
  936. color: $font-color-dark;
  937. }
  938. .yticon {
  939. font-size: 48upx;
  940. margin-bottom: 18upx;
  941. color: #fa436a;
  942. }
  943. .icon-shouhoutuikuan {
  944. font-size: 44upx;
  945. }
  946. }
  947. .history-section {
  948. padding: 30upx 0 0;
  949. margin-top: 20upx;
  950. background: #fff;
  951. border-radius: 10upx;
  952. .sec-header {
  953. display: flex;
  954. align-items: center;
  955. font-size: $font-base;
  956. color: $font-color-dark;
  957. line-height: 40upx;
  958. margin-left: 30upx;
  959. .yticon {
  960. font-size: 44upx;
  961. color: #5eba8f;
  962. margin-right: 16upx;
  963. line-height: 40upx;
  964. }
  965. }
  966. .h-list {
  967. white-space: nowrap;
  968. padding: 30upx 30upx 0;
  969. image {
  970. display: inline-block;
  971. width: 160upx;
  972. height: 160upx;
  973. margin-right: 20upx;
  974. border-radius: 10upx;
  975. }
  976. }
  977. }
  978. .grid {
  979. display: flex;
  980. align-items: center;
  981. flex-wrap: wrap;
  982. /* border-top: 2upx solid rgba(172,172,172,.2); */
  983. .grid-item-3 {
  984. box-sizing: border-box;
  985. width: calc(100% / 3);
  986. border-bottom: 2upx solid rgba(172, 172, 172, .2);
  987. border-right: 2upx solid rgba(172, 172, 172, .2);
  988. text-align: center;
  989. padding: 40upx 0;
  990. position: relative;
  991. /* view{
  992. font-size: $font-sm;
  993. margin-top: 16upx;
  994. color: $font-color-dark;
  995. } */
  996. .grid_icon {
  997. font-size: 48upx;
  998. margin-bottom: 18upx;
  999. color: #fa436a;
  1000. }
  1001. .tip_text {
  1002. display: block;
  1003. padding: 4upx 8upx;
  1004. text-align: center;
  1005. border-radius: 36upx;
  1006. font-size: 24upx;
  1007. background-color: #fa436a;
  1008. color: rgba(255, 255, 255, 1);
  1009. position: absolute;
  1010. right: 6upx;
  1011. top: 6upx;
  1012. }
  1013. }
  1014. .grid-item-3:nth-child(3n + 3),
  1015. .grid-item-4:nth-child(4n + 4) {
  1016. border-right: none;
  1017. }
  1018. }
  1019. .headPortrait {
  1020. width: 75px;
  1021. height: 75px;
  1022. border-radius: 40px;
  1023. border: 2px solid #ffffff;
  1024. }
  1025. .personal {
  1026. margin-top: 10px;
  1027. margin-left: 10px;
  1028. }
  1029. .information {
  1030. font-size: 15px;
  1031. font-weight: 600;
  1032. height: 36px;
  1033. }
  1034. .indexlow {
  1035. /* margin-top: 30px; */
  1036. border-radius: 10px;
  1037. }
  1038. .cu-list>.cu-item:after {
  1039. border: none;
  1040. }
  1041. .sign {
  1042. width: 35px;
  1043. height: 35px;
  1044. top: 4px;
  1045. }
  1046. .sign1 {
  1047. width: 26px;
  1048. height: 26px;
  1049. top: 4px;
  1050. }
  1051. .indexUp {
  1052. padding: 0 20px;
  1053. align-items: center;
  1054. }
  1055. .cu-list.grid>.cu-item .cu-tag.badge {
  1056. color: #fff;
  1057. background: #FF6600;
  1058. font-size: 9px;
  1059. line-height: 5px;
  1060. padding: 5px;
  1061. }
  1062. .cover-container-item {
  1063. background: #fff;
  1064. border-radius: 10px;
  1065. padding: 10px 0;
  1066. }
  1067. .cover-container-item .cu-list {
  1068. margin: 0;
  1069. }
  1070. .cover-container-item .cu-list.grid>.cu-item [class*=cuIcon] {
  1071. margin: 0;
  1072. }
  1073. .guess-section-wrap-item {
  1074. float: left;
  1075. width: 38vw;
  1076. background: #F9F9FA;
  1077. padding: 7px;
  1078. margin: 20rpx;
  1079. border-radius: 3px;
  1080. // width:50%;
  1081. }
  1082. .guess-section-wrap-item:first-child {
  1083. // margin-left:2px;
  1084. }
  1085. .clearfix:after {
  1086. content: "";
  1087. display: block;
  1088. clear: both;
  1089. }
  1090. .guess-section-wrap {
  1091. padding: 15px;
  1092. margin: 10rpx 20rpx;
  1093. border-radius: 5px;
  1094. background: #fff;
  1095. overflow: hidden;
  1096. }
  1097. .guess-section-wrap .price {
  1098. color: #B2B3BB;
  1099. display: flex;
  1100. align-items: center;
  1101. }
  1102. .title {
  1103. font-size: 28upx;
  1104. color: $font-color-dark;
  1105. font-weight: bold;
  1106. height: 50upx;
  1107. line-height: 50upx;
  1108. flex: 2.5;
  1109. }
  1110. .factory {
  1111. font-size: 26rpx;
  1112. font-weight: 900;
  1113. }
  1114. .currectprice {
  1115. color: rgba(253, 113, 79, 1);
  1116. font-size: 18px;
  1117. font-weight: 550;
  1118. vertical-align: middle;
  1119. margin-right: 10px;
  1120. }
  1121. .yesterday {
  1122. font-size: 14px;
  1123. font-weight: 600;
  1124. vertical-align: middle;
  1125. }
  1126. .yesterday.up {
  1127. color: rgba(253, 113, 79, 1);
  1128. }
  1129. .yesterday.down {
  1130. color: #22C572;
  1131. }
  1132. </style>