home.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. <template>
  2. <view class="container">
  3. <image class="background-image" src="/static/images/tabBar/527@2x.png" style="width: 100%;height: 320rpx;"
  4. mode="scaleToFill"></image>
  5. <view>
  6. <view style="display: flex;align-items: center;">
  7. <view style="width: 75%;">
  8. <!-- <uni-search-bar radius="100" placeholder="请输入商品名称" readonly bgColor="#fff"/> -->
  9. <u-search placeholder="请输入商品名称" bgColor="#fff" readonly :showAction="false"
  10. searchIconColor='#E75F37' :searchIconSize='24' margin='20rpx' disabled
  11. @click="insearchPage"></u-search>
  12. </view>
  13. <view style="height: 64rpx;width: 25%;" @click="clickVehicle">
  14. <image class="background-image" src="/static/images/tabBar/car@2x.png"
  15. style="width:164rpx;height: 64rpx;" mode="scaleToFill"></image>
  16. </view>
  17. </view>
  18. </view>
  19. <view style="padding: 0 20rpx 20rpx 20rpx;">
  20. <view style="border-radius: 10rpx;overflow: hidden;" v-if="list3.length>0">
  21. <uni-swiper-dot :info="list3" :current="dotCurrent" mode="round" :dots-styles="dotsStyles">
  22. <swiper circular :autoplay="true" :interval="2000" :duration="500" @change="swiperChange">
  23. <swiper-item v-for="(item,index) in list3" :key="index">
  24. <image mode="scaleToFill" :src="item" @error="imageError" style="width: 100%;height: 100%;">
  25. </image>
  26. </swiper-item>
  27. </swiper>
  28. </uni-swiper-dot>
  29. </view>
  30. <view class="card" v-if="brandList.length >0" style="padding: 20rpx;">
  31. <uni-grid :column="5" :show-border="false" :square="false" :highlight="false">
  32. <uni-grid-item v-for="(item ,index) in brandList" :key="index">
  33. <view class="brandImg" @click="click(index)">
  34. <image :src="item.brandFilesList[0].url" mode="aspectFit"
  35. style="width:88rpx;height: 88rpx;border-radius: 100%;" />
  36. <text class="text">{{item.cname}}</text>
  37. </view>
  38. </uni-grid-item>
  39. <uni-grid-item v-if="brandList.length >= 9 && gengduofalse">
  40. <view class="brandImg" @click="Moreprojectsfun">
  41. <image src="/static/images/view/buyGoods/2842x.png" mode="aspectFit"
  42. style="width:88rpx;height: 88rpx;border-radius: 100%;" />
  43. <text class="text">更多品牌</text>
  44. </view>
  45. </uni-grid-item>
  46. <uni-grid-item v-if="brandList.length >= zsbrandList.length && zsbrandList.length > 8">
  47. <view class="brandImg" @click="shohuifun">
  48. <image src="../../static/images/view/buyGoods/fanhui.png" mode="aspectFit"
  49. style="width:88rpx;height: 88rpx;border-radius: 100%;" />
  50. <text class="text">回收品牌</text>
  51. </view>
  52. </uni-grid-item>
  53. </uni-grid>
  54. </view>
  55. <view @click="inIntegralMall">
  56. <image src="/static/images/tabBar/JF.png" style="width: 100%;height: 251rpx;" mode="scaleToFill">
  57. </image>
  58. </view>
  59. <view class="card">
  60. <u-tabs :list="dianjiqielist" v-model="groupModel" @click="groupChange" :lineHeight='0'
  61. :activeStyle="activeStyle" :inactiveStyle="inactiveStyle"></u-tabs>
  62. <view style="padding: 16rpx;border-top: 2px #F1F1F1 solid;;">
  63. <uni-grid :column="2" :show-border="false" :square="false" :highlight="false"
  64. v-if="dataList.length > 0">
  65. <uni-grid-item v-for="(item ,index) in dataList" :key="index">
  66. <view class="goodsImg" @click="choice(item,index)">
  67. <image v-if="item.inventoryLocal > 0" src="/static/images/tabBar/xsd2x.png"
  68. mode="aspectFit" class='imgIcon' />
  69. <image v-if="item.inventoryLocal == 0&&item.inventoryShare > 0"
  70. src="/static/images/tabBar/crd2x.png" mode="aspectFit" class='imgIcon' />
  71. <image :src="item.url" mode="aspectFit"
  72. style="width:300rpx;height:300rpx;border-radius:20rpx;border: 2rpx #E7E7E7 solid;" />
  73. <text class="text">{{item.cname}}</text>
  74. <text
  75. style="color:#E75F37;width: 300rpx;font-weight: bold;font-size: 32rpx;">¥{{checkStatus == '通过'?item.mallPrice:'***'}}</text>
  76. </view>
  77. </uni-grid-item>
  78. </uni-grid>
  79. <u-empty v-if="dataList.length == 0" mode="list" icon="/static/images/tabBar/emptylist.jpg"
  80. text='暂无数据' />
  81. </view>
  82. </view>
  83. <u-loadmore v-if="page.total !== 0 && dataList.length != 0" :status="status" />
  84. <u-back-top :scroll-top="scrollTop"></u-back-top>
  85. <view v-if="userInfo.tenant_id != '000000'" class="suspensionBox" @click="opensalesman">
  86. <u-icon name="server-fill" color="#2979ff" size="30"></u-icon>
  87. </view>
  88. <u-modal :show="salesmanShow" title="业务员联系方式" showCancelButton confirmText="拨号" cancelText="关闭"
  89. @confirm="clickCall" @cancel="salesmanShow=false">
  90. <view class="slot-content">
  91. <view style="margin-bottom: 10rpx;">业务员:{{salesmanName?salesmanName:''}}</view>
  92. <view>电话:{{phoneNumber?phoneNumber:''}}</view>
  93. </view>
  94. </u-modal>
  95. </view>
  96. </view>
  97. </template>
  98. <script>
  99. import {
  100. appList,
  101. appListNew,
  102. userDept,
  103. validationCorpEmpty,
  104. isProcurement,
  105. brandDescList,
  106. brandDescDetail
  107. } from '@/api/tabBar/homeNew.js'
  108. import {
  109. shoppingCartList
  110. } from '@/api/tabBar/shoppingCart.js'
  111. import {
  112. listAll
  113. } from '@/api/tabBar/classification.js'
  114. import {
  115. details,
  116. nameDetail
  117. } from '@/api/views/personalInformation/index.js'
  118. import {
  119. activityList
  120. } from '@/api/tabBar/activity.js'
  121. export default {
  122. data() {
  123. return {
  124. scrollTop: 0,
  125. activeStyle: {
  126. color: '#E75F37',
  127. fontWeight: 'bold',
  128. fontSize: '28rpx'
  129. },
  130. inactiveStyle: {
  131. color: '#797979',
  132. fontSize: '28rpx'
  133. },
  134. dotsStyles: {
  135. backgroundColor: 'rgba(0, 0, 0, .1)',
  136. border: '1px #fff solid',
  137. color: '#fff',
  138. selectedBackgroundColor: '#fff',
  139. selectedBorder: '1px #fff solid'
  140. },
  141. dotCurrent: 0,
  142. show: false,
  143. search: {},
  144. page: {
  145. total: 0,
  146. size: 10,
  147. current: 1
  148. },
  149. status: 'loadmore',
  150. dataList: [],
  151. list3: [],
  152. brandList: [],
  153. // 静音棉
  154. originalFactory: 0,
  155. // 自修补
  156. selfRecovery: 0,
  157. // 防爆
  158. explosionProof: 0,
  159. dianjiqielist: [{
  160. name: '全部',
  161. },
  162. {
  163. name: '静音棉',
  164. },
  165. {
  166. name: '自修补',
  167. },
  168. {
  169. name: '防爆',
  170. }
  171. ],
  172. groupModel: null,
  173. PPindex: null,
  174. // 品牌
  175. zsbrandList: [],
  176. brandDescfor: 9,
  177. gengduofalse: true,
  178. // 审核状态
  179. checkStatus: '',
  180. enableOrNot: '',
  181. salesmanName: '', // 业务员姓名
  182. phoneNumber: '', // 业务员联系电话
  183. salesmanShow: false, // 联系业务员弹窗
  184. userInfo: {}, // 当前用户数据
  185. }
  186. },
  187. onPageScroll(e) {
  188. this.scrollTop = e.scrollTop;
  189. },
  190. onPullDownRefresh() {
  191. // 调用数据刷新方法
  192. this.refreshData();
  193. setTimeout(() => {
  194. uni.stopPullDownRefresh(); // 停止下拉刷新动画
  195. }, 1000);
  196. },
  197. onReachBottom() {
  198. this.status = 'loading'
  199. if (this.dataList.length < this.page.total) {
  200. this.page.current++
  201. this.onSearch()
  202. } else {
  203. this.status = 'nomore'
  204. }
  205. },
  206. onLoad(e) {
  207. isProcurement({
  208. "param": "whether.open.share"
  209. }).then(res => {
  210. uni.setStorageSync('whether_openShare', res.data);
  211. })
  212. this.userInfo = uni.getStorageSync('userInfo')
  213. // 轮播图
  214. brandDescList({
  215. type: 'LBT',
  216. whetherIntegral: "0"
  217. }).then(res => {
  218. brandDescDetail({
  219. id: res.data.records[0].id
  220. }).then(res => {
  221. this.list3 = res.data.brandFilesList.map(item => {
  222. return item.url
  223. })
  224. })
  225. })
  226. uni.showLoading({
  227. title: '加载中',
  228. mask: true
  229. });
  230. // 判断是怎么登录的
  231. if (JSON.parse(JSON.stringify(uni.getStorageSync('userInfo'))).tenant_id != '000000') {
  232. // 查看是否有客户信息
  233. validationCorpEmpty().then(res => {
  234. uni.hideLoading();
  235. //获取公司名称
  236. userDept().then(res => {
  237. uni.setNavigationBarTitle({
  238. title: res.data.fullName
  239. })
  240. })
  241. //获取所有品牌
  242. listAll({
  243. type: 'PP',
  244. enableOrNot: '1',
  245. whetherIntegral: '0'
  246. }).then(res => {
  247. this.zsbrandList = []
  248. this.brandList = []
  249. // this.zsbrandList = res.data
  250. this.zsbrandList = res.data.sort(this.compare('sort'))
  251. if (this.zsbrandList.length <= 10) {
  252. this.gengduofalse = false
  253. this.brandList = this.zsbrandList
  254. } else {
  255. for (let i in res.data) {
  256. if (i < this.brandDescfor) {
  257. this.brandList.push(res.data[i])
  258. }
  259. }
  260. }
  261. })
  262. this.page = {
  263. total: 0,
  264. size: 10,
  265. current: 1
  266. }
  267. this.dataList = []
  268. this.onSearch()
  269. }).catch(err => {
  270. uni.hideLoading();
  271. uni.$u.route('/pages/views/personalInformation/index');
  272. })
  273. } else {
  274. uni.setNavigationBarTitle({
  275. title: '青岛途宝'
  276. })
  277. //获取所有品牌
  278. listAll({
  279. type: 'PP',
  280. enableOrNot: '1',
  281. whetherIntegral: '0'
  282. }).then(res => {
  283. this.zsbrandList = []
  284. this.brandList = []
  285. // this.zsbrandList = res.data
  286. this.zsbrandList = res.data.sort(this.compare('sort'))
  287. if (this.zsbrandList.length <= 10) {
  288. this.gengduofalse = false
  289. this.brandList = this.zsbrandList
  290. } else {
  291. for (let i in res.data) {
  292. if (i < this.brandDescfor) {
  293. this.brandList.push(res.data[i])
  294. }
  295. }
  296. }
  297. })
  298. this.page = {
  299. total: 0,
  300. size: 10,
  301. current: 1
  302. }
  303. this.dataList = []
  304. this.onSearch()
  305. }
  306. uni.hideLoading();
  307. },
  308. onShow() {
  309. this.getUpdate()
  310. activityList({
  311. current: 1,
  312. size: 10,
  313. status: 1
  314. }).then(res => {
  315. uni.setTabBarBadge({
  316. index: 1, // tabIndex,tabBar的哪一项,从0开始
  317. text: res.data.total.toString() // 显示的文本,超过 99 显示成 “…”
  318. })
  319. })
  320. shoppingCartList({
  321. whetherIntegral: '0'
  322. }).then(res => {
  323. let num = 0
  324. res.data.forEach(e => {
  325. num = num + e.list.length
  326. })
  327. uni.setTabBarBadge({
  328. index: 3, // tabIndex,tabBar的哪一项,从0开始
  329. text: num.toString() // 显示的文本,超过 99 显示成 “…”
  330. })
  331. })
  332. // 获取审核状态
  333. details().then(res => {
  334. this.checkStatus = res.data.checkStatus
  335. this.enableOrNot = res.data.enableOrNot
  336. uni.setStorageSync('checkStatus', res.data.checkStatus);
  337. uni.setStorageSync('enableOrNot', res.data.enableOrNot);
  338. // 查询业务员详情拿取手机号
  339. this.salesmanName = res.data.salesmanName
  340. if (!this.phoneNumber) {
  341. nameDetail({
  342. id: res.data.salesmanId
  343. }).then(res => {
  344. this.phoneNumber = res.data.phone
  345. })
  346. }
  347. })
  348. },
  349. methods: {
  350. getUpdate() {
  351. const updateManager = uni.getUpdateManager();
  352. updateManager.onCheckForUpdate(function(res) {
  353. // 请求完新版本信息的回调
  354. if (res.hasUpdate) {
  355. updateManager.onUpdateReady(function() {
  356. uni.showModal({
  357. title: '更新提示',
  358. content: '新版本已经准备好,是否重启应用?',
  359. success: function(res) {
  360. if (res.confirm) {
  361. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  362. updateManager.applyUpdate();
  363. }
  364. }
  365. });
  366. });
  367. updateManager.onUpdateFailed(function() {
  368. // 新的版本下载失败
  369. uni.showModal({
  370. title: '已经有新版本了哟~',
  371. content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  372. });
  373. });
  374. }
  375. });
  376. },
  377. refreshData() {
  378. listAll({
  379. type: 'PP',
  380. enableOrNot: '1',
  381. whetherIntegral: '0'
  382. }).then(res => {
  383. this.zsbrandList = []
  384. this.brandList = []
  385. // this.zsbrandList = res.data
  386. this.zsbrandList = res.data.sort(this.compare('sort'))
  387. if (this.zsbrandList.length <= 10) {
  388. this.gengduofalse = false
  389. this.brandList = this.zsbrandList
  390. } else {
  391. for (let i in res.data) {
  392. if (i < this.brandDescfor) {
  393. this.brandList.push(res.data[i])
  394. }
  395. }
  396. }
  397. })
  398. this.page = {
  399. total: 0,
  400. size: 10,
  401. current: 1
  402. }
  403. this.search = {}
  404. this.dataList = []
  405. this.onSearch()
  406. },
  407. insearchPage() {
  408. if (this.checkStatus != '通过') {
  409. uni.showToast({
  410. title: "当前用户未授权,请联系客服",
  411. icon: "none",
  412. mask: true
  413. });
  414. return
  415. }
  416. uni.switchTab({
  417. url: '/pages/tabBar/classification'
  418. });
  419. },
  420. // 车型
  421. clickVehicle() {
  422. if (this.checkStatus != '通过') {
  423. uni.showToast({
  424. title: "当前用户未授权,请联系客服",
  425. icon: "none",
  426. mask: true
  427. });
  428. return
  429. }
  430. this.$u.route('/pages/tabBar/vehicleModel');
  431. },
  432. swiperChange(e) {
  433. this.dotCurrent = e.detail.current;
  434. },
  435. // 点击联系业务员
  436. clickCall() {
  437. uni.makePhoneCall({
  438. phoneNumber: this.phoneNumber,
  439. success: function() {
  440. console.log('拨打电话成功');
  441. this.salesmanShow = false
  442. },
  443. fail() {
  444. console.log('打电话失败了');
  445. this.salesmanShow = false
  446. }
  447. })
  448. },
  449. // 数组排序 property:根据什么属性排序
  450. compare(property) {
  451. return function(a, b) {
  452. var value1 = a[property]
  453. var value2 = b[property]
  454. return value1 - value2
  455. }
  456. },
  457. // 更多项目盒子
  458. Moreprojectsfun() {
  459. this.brandDescfor += 5
  460. this.brandList = []
  461. console.log(123);
  462. for (let i in this.zsbrandList) {
  463. if (i < this.brandDescfor) {
  464. this.brandList.push(this.zsbrandList[i])
  465. }
  466. }
  467. if (this.brandDescfor >= this.zsbrandList.length) {
  468. this.gengduofalse = false
  469. }
  470. },
  471. // 收回项目
  472. shohuifun() {
  473. this.brandDescfor = 9
  474. this.brandList = []
  475. for (let i in this.zsbrandList) {
  476. if (i < this.brandDescfor) {
  477. this.brandList.push(this.zsbrandList[i])
  478. }
  479. }
  480. this.gengduofalse = true
  481. // if (this.brandDescfor >= this.zsbrandList.length) {
  482. // this.gengduofalse = false
  483. // }
  484. },
  485. groupChange(e) {
  486. console.log(e, 228);
  487. if (e.name == '静音棉') {
  488. this.originalFactory = 1
  489. this.selfRecovery = 0
  490. this.explosionProof = 0
  491. } else if (e.name == '自修补') {
  492. this.originalFactory = 0
  493. this.selfRecovery = 1
  494. this.explosionProof = 0
  495. } else if (e.name == '防爆') {
  496. this.originalFactory = 0
  497. this.selfRecovery = 0
  498. this.explosionProof = 1
  499. } else {
  500. this.originalFactory = 0
  501. this.selfRecovery = 0
  502. this.explosionProof = 0
  503. }
  504. this.page.current = 1
  505. this.dataList = []
  506. this.onSearch()
  507. },
  508. // 点击筛选条件
  509. dianjiqiehuan(name) {
  510. if (this[name] == 0) {
  511. this[name] = 1
  512. } else {
  513. this[name] = 0
  514. }
  515. this.click()
  516. },
  517. // 获取列表数据
  518. onSearch() {
  519. uni.showLoading({
  520. title: '加载中',
  521. mask: true
  522. });
  523. let obj = {}
  524. if (this.originalFactory) {
  525. obj.originalFactory = 1
  526. }
  527. if (this.selfRecovery) {
  528. obj.selfRecovery = 1
  529. }
  530. if (this.explosionProof) {
  531. obj.explosionProof = 1
  532. }
  533. if (uni.getStorageSync('whether_openShare') == 1) {
  534. appListNew({
  535. size: this.page.size,
  536. current: this.page.current,
  537. ...obj,
  538. ...this.search,
  539. whetherIntegral: 0
  540. }).then(res => {
  541. this.dataList = this.dataList.concat(res.data.records)
  542. this.page.total = res.data.total
  543. if (this.dataList.length == res.data.total) {
  544. this.status = 'nomore'
  545. }
  546. uni.hideLoading();
  547. }).catch(err => {
  548. uni.hideLoading();
  549. })
  550. } else {
  551. appList({
  552. size: this.page.size,
  553. current: this.page.current,
  554. ...obj,
  555. ...this.search,
  556. whetherIntegral: 0
  557. }).then(res => {
  558. this.dataList = this.dataList.concat(res.data.records)
  559. this.page.total = res.data.total
  560. if (this.dataList.length == res.data.total) {
  561. this.status = 'nomore'
  562. }
  563. uni.hideLoading();
  564. }).catch(err => {
  565. uni.hideLoading();
  566. })
  567. }
  568. },
  569. close() {
  570. this.show = false
  571. this.search.brandId = ''
  572. this.search.brandName = ''
  573. },
  574. // 原厂点击差号
  575. yuanchangclose(type) {
  576. if (type == 'originalFactory') {
  577. this.originalFactory = false
  578. } else if (type == 'selfRecovery') {
  579. this.selfRecovery = false
  580. } else {
  581. this.explosionProof = false
  582. }
  583. this.click()
  584. },
  585. click(name) {
  586. if (this.checkStatus != '通过') {
  587. uni.showToast({
  588. title: "当前用户未授权,请联系客服",
  589. icon: "none",
  590. mask: true
  591. });
  592. return
  593. }
  594. if (name != undefined) {
  595. this.page = {
  596. total: 0,
  597. size: 10,
  598. current: 1,
  599. }
  600. this.dataList = []
  601. if (this.PPindex == name) {
  602. this.PPindex = null
  603. delete this.search.brandId
  604. delete this.search.brandNmae
  605. } else {
  606. this.PPindex = name
  607. this.search = {
  608. ...this.search,
  609. brandId: this.brandList[this.PPindex].id,
  610. brandNmae: this.brandList[this.PPindex].cname,
  611. }
  612. }
  613. }
  614. this.show = true
  615. this.onSearch()
  616. },
  617. //打开明细
  618. choice(item, index) {
  619. if (this.checkStatus != '通过') {
  620. uni.showToast({
  621. title: "当前用户未授权,请联系客服",
  622. icon: "none",
  623. mask: true
  624. });
  625. return
  626. }
  627. uni.$u.route('/pages/views/buyGoods/commodityDetails', {
  628. id: item.id
  629. });
  630. },
  631. opensalesman() {
  632. if (this.checkStatus != '通过') {
  633. uni.showToast({
  634. title: "当前用户未授权,请联系客服",
  635. icon: "none",
  636. mask: true
  637. });
  638. return
  639. }
  640. this.salesmanShow = true
  641. },
  642. inIntegralMall() {
  643. if (this.checkStatus != '通过') {
  644. uni.showToast({
  645. title: "当前用户未授权,请联系客服",
  646. icon: "none",
  647. mask: true
  648. });
  649. // uni.switchTab({
  650. // url: '/pages/tabBar/home'
  651. // })
  652. return
  653. }
  654. uni.$u.route('/pages/integralMall/index');
  655. }
  656. }
  657. }
  658. </script>
  659. <style lang="scss" scoped>
  660. .suspensionBox {
  661. width: 80rpx;
  662. height: 80rpx;
  663. background: #fff;
  664. border-radius: 50%;
  665. position: fixed;
  666. top: 92%;
  667. right: 40rpx;
  668. box-shadow: 4px 4px 8px 1px rgba(0, 0, 0, .5);
  669. display: flex;
  670. align-items: center;
  671. justify-content: center;
  672. }
  673. .card {
  674. background-color: #fff;
  675. border-radius: 10rpx;
  676. overflow: hidden;
  677. margin: 12rpx 0;
  678. }
  679. .carBtn {
  680. display: flex;
  681. align-items: center;
  682. justify-content: center;
  683. color: #E75F37;
  684. font-weight: bold;
  685. width: 25%;
  686. text-align: center;
  687. background-color: #fff;
  688. height: 64rpx;
  689. border-radius: 36rpx;
  690. margin-right: 20rpx;
  691. }
  692. .brandImg {
  693. display: flex;
  694. flex-direction: column;
  695. align-items: center;
  696. justify-content: center;
  697. margin: 16rpx 0;
  698. .text {
  699. white-space: nowrap;
  700. overflow: hidden;
  701. text-overflow: ellipsis;
  702. width: 140rpx;
  703. text-align: center;
  704. font-size: 24rpx;
  705. color: #797979;
  706. }
  707. }
  708. .goodsImg {
  709. display: flex;
  710. flex-direction: column;
  711. align-items: center;
  712. justify-content: center;
  713. margin: 16rpx 0;
  714. .text {
  715. white-space: nowrap;
  716. overflow: hidden;
  717. text-overflow: ellipsis;
  718. width: 300rpx;
  719. text-align: center;
  720. font-size: 24rpx;
  721. color: #797979;
  722. }
  723. }
  724. .container {
  725. position: relative;
  726. }
  727. .background-image {
  728. position: absolute;
  729. z-index: -1;
  730. /* 将图片置于组件后面 */
  731. }
  732. .imgIcon {
  733. position: absolute;
  734. width: 100rpx;
  735. height: 35rpx;
  736. top: 16rpx;
  737. right: 36rpx;
  738. }
  739. </style>