You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

970 lines
30 KiB

6 months ago
  1. <template>
  2. <view>
  3. <!-- 状态栏 -->
  4. <view class="header">
  5. <view class="input-box" @tap="toSearch()">
  6. <input placeholder="输入商品名称" placeholder-style="color:#c0c0c0;" disabled="disabled" />
  7. <view class="icon search"></view>
  8. </view>
  9. </view>
  10. <!-- 占位 -->
  11. <view class="place"></view>
  12. <view class="toplist" style="position: relative;z-index: 1;">
  13. <mstabs :list="dfllist" v-model="dflindex" :lineAnimated="false" itemColor="#4D9864" lineColor="#4D9864"></mstabs>
  14. </view>
  15. <view class="category-list">
  16. <scroll-view scroll-y="true" class="left" :scroll-into-view="leftIntoView">
  17. <view class="row" v-for="(category,index) in xfllist" :key="category.id" :class="{ 'on':index==leftIndex }" @tap="leftTap(index)"
  18. :data-index="index" :id="'left-'+index">
  19. <view class="text">
  20. <view class="block"></view>
  21. {{category.fenlmc}}
  22. </view>
  23. </view>
  24. </scroll-view>
  25. <scroll-view :scroll-top="scrollTop" scroll-y="isscoll" class="right" @scrolltolower="onscrolltolower" @scrolltoupper="onscrolltoupper" @scroll="mainScroll" :scroll-into-view="scrollInto"
  26. scroll-with-animation="true">
  27. <view class="right-goods" :style="{height:tiancheight+'px'}">
  28. <view class="category" v-for="(v,i) in prodata" :key="i" :id="'item-'+i">
  29. <view class="twoListName" v-if="v!=''">{{xfllist[i].fenlmc}}</view>
  30. <view class="good_list" v-for="(product,index) in v" :key="index" @click="toGoods(product)">
  31. <view class="goodleft">
  32. <image :src="product.img"></image>
  33. </view>
  34. <view class="goodright">
  35. <view class="cpmc">{{ product.mc }}&nbsp;{{product.gg}}</view>
  36. <view :class="product.miaosstyle" @tap.stop="changemiaosstyle(index)">
  37. {{product.miaos}}
  38. </view>
  39. <view>
  40. <text>{{ product.price }}{{product.dw}}</text>
  41. <text style="margin-left: 10upx;">库存&nbsp;{{ product.kcnum }}</text>
  42. </view>
  43. <!-- <view>
  44. <text class="sdtext">{{ product.sdtext }}</text>
  45. </view> -->
  46. <view style="padding:0upx 8upx; color: grey; display: flex;align-items: center;" @tap.stop v-if="product.inputnum">
  47. <input style="font-size: 28upx;color: #41A863;height: 40upx; line-height: 40upx; min-height: 40upx;" type="text" :value="product.bz" @input="inputchangeBz($event,product.bz,product.id,product.kcnum,2)" placeholder="输入备注">
  48. <input style="font-size: 28upx;color: #41A863;height: 40upx; line-height: 40upx; min-height: 40upx;" type="text" :value="product.fudw" @input="inputchangeFudw($event,product.fudw,product.id,product.kcnum,2)" placeholder="输入副单位">
  49. </view>
  50. <view class="rfoot">
  51. <view class="stopbuy" v-if="product.isokorder==0">
  52. {{product.opentime}}
  53. </view>
  54. <view class="p-b-btn" :class="{active: product.iscollect}" @click.stop="toFavorite(product.id,index,0,i)">
  55. <text class="yticon icon-shoucang"></text>
  56. </view>
  57. <view class="nosell" v-if="product.kcnum<=0"><text>已售空</text></view>
  58. <view class="number" v-if="product.kcnum">
  59. <view class="sub" @tap.stop="sub(product.id,i)">
  60. <view class="jian">-</view>
  61. </view>
  62. <view class="input" @tap.stop="discard" >
  63. <input type="digit" v-model="product.inputnum==0?'':product.inputnum" @input="inputchange($event,product.inputnum,product.id,product.kcnum,i)" />
  64. </view>
  65. <view class="add" @tap.stop="add(product.id,i,product.kcnum)">
  66. <view class="jia">
  67. <image src="../../static/img/addicon.png"></image>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="loadtext">{{loadingText}}</view>
  76. </view>
  77. </scroll-view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import mstabs from "@/components/ms-tabs/ms-tabs.vue";
  83. export default {
  84. components: {
  85. mstabs
  86. },
  87. data() {
  88. return {
  89. //分类列表
  90. dfllist: [],
  91. xfllist: [],
  92. dflindex: 0, //初始第一分类id
  93. xflid: 0,
  94. goodlist: [],
  95. cartlist: [], //购物车商品列表
  96. miaosstyle: 'miaos',
  97. scrollHeight: 0,
  98. prodata: [], //当前一级分类下所有属于二级分类的商品数据
  99. leftIndex: 0, //左边规定位置下标
  100. scrollInto: '', //滚动位置
  101. scrollTop: 0,
  102. old: {
  103. scrollTop: 0
  104. },
  105. aid: 0, //在页面保存其它页面传来的列表id ,做滚动列表位置
  106. twolevalid: [], //二级分类全部id
  107. isscoll: false, //scollview默认不可滑动,等待数据渲染完成之后可滑动
  108. level2: [],
  109. tiancheight:0,
  110. loadingText: '上滑加载更多...',
  111. flag:true,
  112. isPost:true,
  113. userinfo:[],
  114. tmp_data:[],
  115. pagenum:1,
  116. dflidkey:0,
  117. }
  118. },
  119. onPageScroll(e) {
  120. //兼容iOS端下拉时顶部漂移
  121. if (e.scrollTop >= 0) {
  122. this.headerPosition = "fixed";
  123. } else {
  124. this.headerPosition = "absolute";
  125. }
  126. },
  127. watch: {
  128. dflindex() {
  129. if(this.dflidkey==0){
  130. var that=this;
  131. this.xfllist = this.level2[this.dflindex];
  132. this.leftIndex=0;
  133. this.pagenum=1;
  134. this.tmp_data=[];
  135. that.getgoods(that.xfllist[0].id,0,1);
  136. }else{
  137. this.dflidkey=0;
  138. }
  139. }
  140. },
  141. async onShow(e) {
  142. // let xflid = getApp().globalData.xflid;
  143. // let userid = uni.getStorageSync('userinfo');
  144. // //带了产品分类id或变换了账号,需刷新页面产品
  145. // if (xflid!='' || userid.uid!=this.userinfo.uid){
  146. // this.init();
  147. // }
  148. let dflid = getApp().globalData.dflid;
  149. let userid = uni.getStorageSync('userinfo');
  150. //带了产品分类id或变换了账号,需刷新页面产品
  151. if (dflid!='' || userid.uid!=this.userinfo.uid){
  152. this.init();
  153. }
  154. this.checkshownum();
  155. },
  156. async onLoad() {
  157. this.init();
  158. },
  159. computed: {
  160. /* 计算左侧滚动位置定位 */
  161. leftIntoView() {
  162. return `left-${this.leftIndex}`;
  163. }
  164. },
  165. //加载更多
  166. methods: {
  167. async init(){
  168. let t = this;
  169. this.userinfo = uni.getStorageSync('userinfo');
  170. //通过其他页面进来的定位
  171. let dflid = getApp().globalData.dflid;
  172. let xflid = getApp().globalData.xflid;
  173. getApp().globalData.dflid='';//获取了值就立马清空这个全局变量
  174. getApp().globalData.xflid='';//获取了值就立马清空这个全局变量
  175. console.log(dflid);
  176. let getdata = await this.$api.getcategory({
  177. action: 'categorys',
  178. pid: 0,
  179. uid: this.userinfo.uid,
  180. aid: this.userinfo.aid
  181. });
  182. this.dfllist = getdata.data[0]; //一级分类
  183. this.level2 = getdata.data[1]; //全部的二级分类
  184. for (let i = 0; i < this.dfllist.length; i++) {
  185. if (this.dfllist[i].id == dflid) {
  186. //通过id来定位下标
  187. this.dflindex = i;
  188. console.log(i);
  189. }
  190. }
  191. this.xfllist = this.level2[this.dflindex]; //当前选中的一级分类下的二级分类
  192. // // DOM 挂载后 再调用 getElementTop 获取高度的方法。
  193. this.$nextTick(function() {
  194. this.isscoll = true;
  195. uni.hideLoading()
  196. })
  197. let xflindex=0;
  198. if(xflid==''){
  199. xflid=this.xfllist[0].id;
  200. }
  201. // else{
  202. // this.dflidkey=1;
  203. // for (let i = 0; i < this.xfllist.length; i++) {
  204. // if (this.xfllist[i].id == xflid) {
  205. // //通过id来定位下标
  206. // xflindex = i;
  207. // }
  208. // }
  209. // }
  210. this.$nextTick(function() {
  211. this.pagenum=1;
  212. this.tmp_data=[];
  213. this.getgoods(xflid,xflindex,1)//获取分类下的产品
  214. this.leftIndex=xflindex;
  215. this.isfirst = 1;
  216. })
  217. },
  218. getsysteminfo(){
  219. let that=this;
  220. const {
  221. windowWidth,
  222. windowHeight
  223. } = uni.getSystemInfoSync();
  224. let scrollHeight = windowHeight - 95;
  225. that.tiancheight=scrollHeight+15;
  226. },
  227. //跳详情页
  228. toGoods(good) {
  229. uni.navigateTo({
  230. url: '../product/detail?gid=' + good.id + "&price=" + good.price
  231. })
  232. },
  233. //搜索跳转
  234. toSearch() {
  235. uni.showLoading({
  236. title: '加载中...'
  237. })
  238. uni.navigateTo({
  239. url: `/pages/search/search`
  240. })
  241. uni.hideLoading()
  242. //uni.showToast({title: "建议跳转到新页面做搜索功能"});
  243. },
  244. /* 左侧导航点击 */
  245. leftTap(key) {
  246. this.leftIndex = key;
  247. this.$nextTick(function() {
  248. this.pagenum=1;
  249. this.tmp_data=[];
  250. this.scrollTop = 0
  251. this.getgoods(this.xfllist[key].id,key,1);
  252. });
  253. },
  254. /* 主区域滚动监听 */
  255. mainScroll(e) {
  256. this.old.scrollTop = e.detail.scrollTop;
  257. },
  258. onscrolltoupper(e){
  259. // let index=this.leftIndex-1;
  260. // let newlist=this.prodata;
  261. // this.prodata=[];
  262. // this.prodata=newlist;
  263. // if(index>=0 && index<this.xfllist.length){
  264. // let xflid=this.xfllist[index].id;
  265. // this.leftIndex=index;
  266. // this.getgoods(xflid,index,0);
  267. // }
  268. },
  269. onscrolltolower(e){
  270. let index=this.leftIndex+1;
  271. if(index>=0 && index<this.xfllist.length && this.tmp_data==''){
  272. this.pagenum=1;
  273. let xflid=this.xfllist[index].id;
  274. this.leftIndex=index;
  275. this.getgoods(xflid,index,0);
  276. }else if(this.tmp_data!=''){
  277. this.pagenum++;
  278. let xflid=this.xfllist[this.leftIndex].id;
  279. this.getgoods(xflid,this.leftIndex,0);
  280. }else{
  281. this.loadingText="无更多数据了!";
  282. }
  283. },
  284. //获取分类下的产品
  285. async getgoods(xflid,xflindex,lx) {
  286. // this.isPost=false;
  287. let that = this;
  288. that.scrollTop = 0; //定位右侧商品内容位置
  289. uni.showLoading({
  290. title: '正在加载...'
  291. })
  292. //通过二级分类查产品
  293. let getdata = await this.$api.getgoodlist({
  294. action: 'goodlist2',
  295. uid: this.userinfo.uid,
  296. fid: xflid,
  297. keywords: this.keyword,
  298. pagenum: this.pagenum,
  299. aid: this.userinfo.aid
  300. });
  301. if(lx==1){
  302. this.prodata=[];
  303. for(let i=0;i<=this.xfllist.length;i++){
  304. this.prodata[i]='';
  305. }
  306. }
  307. if (getdata.data.length == 0) {
  308. this.loadmore = 0;
  309. this.loadingText = "无更多数据";
  310. } else {
  311. this.tmp_data= this.tmp_data.concat(getdata.data);
  312. this.prodata[xflindex] = this.tmp_data;
  313. }
  314. // this.prodata[xflindex] = getdata.data;
  315. // that.$forceUpdate();
  316. this.$nextTick(function() {
  317. uni.hideLoading();
  318. that.getsysteminfo();
  319. })
  320. if(lx==1){
  321. that.scrollTop = that.old.scrollTop;
  322. that.$nextTick(function() { //初始化scollview的顶部位置,每次切换tab时top值必须为空0
  323. that.scrollTop = 0;
  324. })
  325. that.$forceUpdate();
  326. }
  327. this.checkshownum();
  328. },
  329. async addcollection(id, index, a, levalkey) {
  330. let type = !this.prodata[levalkey][index].iscollect;
  331. if (this.userinfo) {
  332. let redata = await this.$api.addcollection({
  333. action: 'addcollection',
  334. type: type,
  335. uid: this.userinfo.uid,
  336. id: id,
  337. aid: this.userinfo.uid,
  338. });
  339. uni.showToast({
  340. title: redata.msg,
  341. icon: 'none'
  342. })
  343. if (redata.code == 1) {
  344. this.prodata[levalkey][index].iscollect = !this.prodata[levalkey][index].iscollect;
  345. }
  346. this.$forceUpdate();
  347. } else {
  348. uni.navigateTo({
  349. url: '/pages/user/login'
  350. })
  351. }
  352. },
  353. //收藏
  354. toFavorite(id, index, type, key) {
  355. this.addcollection(id, index, type, key);
  356. },
  357. //减操作
  358. sub(id) {
  359. let getcartlist = uni.getStorageSync('cartlist');
  360. let isexit = this.findidfromstor(id);
  361. let delid = 0;
  362. for (let i = 0; i < getcartlist.length; i++) {
  363. if (isexit.id == getcartlist[i].id) { //找到商品一样的商品
  364. getcartlist[i].num--; //数量减
  365. if (getcartlist[i].num <= 0) {
  366. //删除当前商品缓存
  367. getcartlist.splice(i, 1);
  368. uni.setStorageSync('cartlist', getcartlist)
  369. break; //跳出循环
  370. } else {
  371. getcartlist[i].total = getcartlist[i].num * getcartlist[i].price
  372. uni.setStorageSync('cartlist', getcartlist)
  373. break; //跳出循环
  374. }
  375. }
  376. }
  377. this.checkshownum();
  378. },
  379. // 增加数量,type 0-推荐商品,1-猜你喜欢商品
  380. add(id, key,cknum) {
  381. let getcartlist = uni.getStorageSync('cartlist');
  382. //首次加购物车
  383. if (getcartlist == '') {
  384. this.cartlist = [];
  385. this.cartlist.push(this.findarrbyid(id, key));
  386. //计算每个商品的总价格
  387. this.cartlist.map((item, index) => {
  388. item.total = item.price * item.num
  389. });
  390. uni.setStorageSync('cartlist', this.cartlist);
  391. } else {
  392. //已有商品在购物车
  393. let isexit = this.findidfromstor(id, key);
  394. if (!isexit) {
  395. //购物车中还没当前商品
  396. //不存在
  397. getcartlist.push(this.findarrbyid(id, key));
  398. for (let i = 0; i < getcartlist.length; i++) {
  399. if (id == getcartlist[i].id) {
  400. getcartlist[i].total = getcartlist[i].num * getcartlist[i].price
  401. }
  402. }
  403. uni.setStorageSync('cartlist', getcartlist);
  404. } else {
  405. //存在
  406. for (let i = 0; i < getcartlist.length; i++) {
  407. if (isexit.id == getcartlist[i].id) { //找到商品一样的商品
  408. if(cknum<=getcartlist[i].num){
  409. uni.showToast({
  410. title:'库存不足!',
  411. icon:'none'
  412. });
  413. break; //跳出循环
  414. }
  415. getcartlist[i].num++; //数量自增
  416. getcartlist[i].total = getcartlist[i].num * getcartlist[i].price
  417. uni.setStorageSync('cartlist', getcartlist)
  418. break; //跳出循环
  419. }
  420. }
  421. }
  422. }
  423. this.checkshownum();
  424. },
  425. // input框直接加入购物车
  426. inputadd(id,key,inputnum) {
  427. let getcartlist = uni.getStorageSync('cartlist');
  428. //首次加购物车
  429. if (getcartlist == '') {
  430. this.cartlist = [];
  431. this.cartlist.push(this.findarrbyid(id, key));
  432. //计算每个商品的总价格
  433. this.cartlist.map((item, index) => {
  434. item.total = parseFloat((item.price * inputnum) * 100) / 100;
  435. item.num = parseFloat(inputnum);
  436. });
  437. uni.setStorageSync('cartlist', this.cartlist);
  438. } else {
  439. //已有商品在购物车
  440. let isexit = this.findidfromstor(id, key);
  441. if (!isexit) {
  442. //购物车中还没当前商品
  443. //不存在
  444. getcartlist.push(this.findarrbyid(id, key));
  445. for (let i = 0; i < getcartlist.length; i++) {
  446. if (id == getcartlist[i].id) {
  447. getcartlist[i].total = parseFloat((inputnum * getcartlist[i].price) * 100) / 100;
  448. getcartlist[i].num = parseFloat(inputnum);
  449. }
  450. }
  451. uni.setStorageSync('cartlist', getcartlist);
  452. } else {
  453. //存在
  454. for (let i = 0; i < getcartlist.length; i++) {
  455. if (isexit.id == getcartlist[i].id) { //找到商品一样的商品
  456. getcartlist[i].num=inputnum; //数量自增
  457. if(getcartlist[i].kcnum<=getcartlist[i].num){
  458. uni.showToast({
  459. title:'库存不足!',
  460. icon:'none'
  461. });
  462. break; //跳出循环
  463. }
  464. getcartlist[i].total = parseFloat((getcartlist[i].num * getcartlist[i].price) * 100) / 100
  465. uni.setStorageSync('cartlist', getcartlist)
  466. break; //跳出循环
  467. }
  468. }
  469. }
  470. }
  471. this.checkshownum();
  472. },
  473. inputchange(inputsl,inputnum, id, kcnum,key) {
  474. inputnum=parseFloat(inputsl.detail.value);
  475. let getcartlist = uni.getStorageSync('cartlist');
  476. if (inputnum > 0) {
  477. if (inputnum > kcnum) {
  478. uni.showToast({
  479. title: '库存不足',
  480. icon: 'none'
  481. })
  482. return;
  483. }
  484. this.inputadd(id,key,inputnum);//input框直接添加购物车
  485. } else {
  486. for (let i = 0; i < getcartlist.length; i++) {
  487. if (id == getcartlist[i].id) { //找到商品一样的商品
  488. getcartlist[i].num = 0;
  489. uni.setStorageSync('cartlist', getcartlist)
  490. break; //跳出循环
  491. }
  492. }
  493. this.checkshownum();
  494. }
  495. },
  496. inputchangeBz(inputsl,inputnum, id, kcnum,type) {
  497. inputnum=inputsl.detail.value;
  498. let getcartlist = uni.getStorageSync('cartlist');
  499. let isbz=0;
  500. for (let i = 0; i < getcartlist.length; i++) {
  501. if (id == getcartlist[i].id) { //找到商品一样的商品
  502. getcartlist[i].bz = inputnum;
  503. uni.setStorageSync('cartlist', getcartlist)
  504. isbz=1;
  505. break; //跳出循环
  506. }
  507. }
  508. if(isbz==0){
  509. uni.showToast({title:'请您输入数量后再填备注',icon:'none'});
  510. return;
  511. }
  512. this.checkshownum();
  513. },
  514. inputchangeFudw(inputsl,inputnum, id, kcnum,type) {
  515. inputnum=inputsl.detail.value;
  516. let getcartlist = uni.getStorageSync('cartlist');
  517. let is=0;
  518. for (let i = 0; i < getcartlist.length; i++) {
  519. if (id == getcartlist[i].id) { //找到商品一样的商品
  520. getcartlist[i].fudw = inputnum;
  521. uni.setStorageSync('cartlist', getcartlist)
  522. is=1;
  523. break; //跳出循环
  524. }
  525. }
  526. if(is==0){
  527. uni.showToast({title:'请您输入数量后再填副单位',icon:'none'});
  528. return;
  529. }
  530. this.checkshownum();
  531. },
  532. //初始化购物车数据
  533. checkshownum() {
  534. let getcartlist = uni.getStorageSync('cartlist');
  535. let carid = [];let carbz = [];let carfudw = [];
  536. let prodata = this.prodata;
  537. for (let i = 0; i < getcartlist.length; i++) {
  538. if(getcartlist[i]!=''){
  539. let num = carid[getcartlist[i]['id']] || 0
  540. carid[getcartlist[i]['id']] = parseFloat(num) + parseFloat(getcartlist[i]['num']);
  541. carbz[getcartlist[i]['id']] = getcartlist[i]['bz'];
  542. carfudw[getcartlist[i]['id']] = getcartlist[i]['fudw'];
  543. }
  544. }
  545. for (let i = 0; i < prodata.length; i++) {
  546. if(prodata[i]!=''){
  547. for (let y = 0; y < prodata[i].length; y++) {
  548. if (carid[prodata[i][y]['id']]) {
  549. this.$set(this.prodata[i][y], 'inputnum', carid[prodata[i][y]['id']])
  550. this.$set(this.prodata[i][y], 'bz', carbz[prodata[i][y]['id']])
  551. this.$set(this.prodata[i][y], 'fudw', carfudw[prodata[i][y]['id']])
  552. } else {
  553. this.$set(this.prodata[i][y], 'inputnum', 0)
  554. this.$set(this.prodata[i][y], 'bz', '')
  555. this.$set(this.prodata[i][y], 'fudw', '')
  556. }
  557. }
  558. }
  559. }
  560. this.$forceUpdate();
  561. },
  562. //查找商品
  563. findarrbyid(id, key) {
  564. let arr = this.prodata[key];
  565. for (let i = 0; i < arr.length; i++) {
  566. if (arr[i]['id'] == id) {
  567. //console.log(arr[i],'要保存的东西')
  568. return arr[i];
  569. break; //跳出循环
  570. }
  571. }
  572. },
  573. //从本地存储中根据id获取数组
  574. findidfromstor(id) {
  575. let arr = uni.getStorageSync('cartlist');
  576. for (let i = 0; i < arr.length; i++) {
  577. if (arr[i]['id'] == id) {
  578. return arr[i];
  579. break; //跳出循环
  580. }
  581. }
  582. },
  583. //点击改变描述显示
  584. changemiaosstyle(index) {
  585. let item = this.goodlist[index]
  586. item.checked = !item.checked
  587. if (item.miaosstyle == 'miaos') {
  588. item.miaosstyle = 'miaosshow';
  589. } else {
  590. item.miaosstyle = 'miaos';
  591. }
  592. this.$set(this.goodlist, index, item)
  593. },
  594. discard() {
  595. //丢弃,防止事件冒泡而设
  596. }
  597. }
  598. }
  599. </script>
  600. <style lang="scss">
  601. @font-face {
  602. font-family: "HMfont-home";
  603. src: url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAABDkAAsAAAAAHNQAABCUAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCEOAqqPKIAATYCJAM4Cx4ABCAFhG0HgUIbsBczo8LGAQApXpzs/3DAzQnrqJVQobqjkywr6K3VnnGPu9Hok7hbbDQrMa3YYH8hMXBogoTzwQb7Cx1kafc7LoV7nPdDKXng//D1vvHHmJQxLb6PhyYHA5TjobT1Ahe8Yj0Bel0CGZ62+e/eIdwdcCPswEj8LgoVo7G/whxWfmb0JgvdWPLFRbsoNzNXdS7DRYaDbmUCvEXgheNFZKuuXTu+aEU1WZOVcF6HmhlSCYD7H5tIg0qTmVZRu7s/lUSaaoKS9pbWFqJJPkHSvAEC8qYvrtm2JxQywhzK2SfN9jDt5aDpt8kIchy0s3wRg+cEDyyL1Gjv/0BR8z+X2vyO6G5ACjPM2Jv/kxz8wNafHP0SH7XNFUltLPemCOSEuj/MFYBU5wAtGDXh5vzUTW2j/5KagmzC/t9v7y4vg+OMRLwoYBX7mq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IV8liyPlcleA5CaB+B83q0HC/48PJ97iy7vw4MfROonLACLCsfO1T7LoqIxoojYFo6BS/T8GH+31h6tu3zaeULDhNdPPcZvdc7Qj3VGVT29KuguM6o06vjx/sR0DJcii9durAZOTrhOW8eVPYQOP9IULCnZnYOYjJRz21e+5HX2NhhHO9FUBw6rmB9n6a7jdL76eziU/M0YUW0/Hkd0CW2Jzt0/khCxnsSEviTnQC4WfegavUP5
  604. }
  605. .icon {
  606. font-family: "HMfont-home" !important;
  607. font-size: 60upx;
  608. font-style: normal;
  609. color: #000000;
  610. &.search {
  611. &:before {
  612. content: "\e628";
  613. }
  614. }
  615. &.xia {
  616. &:before {
  617. content: "\e689";
  618. }
  619. }
  620. }
  621. .loadtext {
  622. display: flex;
  623. justify-content: center;
  624. font-size: 25upx;
  625. color: #D6D6D6;
  626. margin-bottom: 20upx;
  627. margin-top: 20upx;
  628. }
  629. .twoListName {
  630. display: block;
  631. text-align: center;
  632. color: #348143;
  633. padding: 30upx 0;
  634. font-size: 30upx;
  635. font-weight: bold;
  636. }
  637. .stopbuy {
  638. margin-top: 15upx;
  639. font-size: 28upx;
  640. color: #F2F5F2;
  641. padding: 15upx;
  642. border-radius: 5upx;
  643. background-color: #B7B7B7;
  644. text-align: center;
  645. }
  646. .status {
  647. width: 100%;
  648. height: 0;
  649. position: fixed;
  650. z-index: 10;
  651. background-color: #fff;
  652. top: 0;
  653. /* #ifdef APP-PLUS */
  654. height: var(--status-bar-height); //覆盖样式
  655. /* #endif */
  656. }
  657. .header {
  658. width: 100%;
  659. padding: 0 5%;
  660. height: 100upx;
  661. display: flex;
  662. align-items: center;
  663. position: fixed;
  664. top: 0;
  665. z-index: 10;
  666. background-color: #fff;
  667. /* #ifdef APP-PLUS */
  668. top: var(--status-bar-height);
  669. /* #endif */
  670. .input-box {
  671. width: 100%;
  672. height: 60upx;
  673. background-color: #f5f5f5;
  674. border-radius: 30upx;
  675. position: relative;
  676. display: flex;
  677. align-items: center;
  678. .icon {
  679. display: flex;
  680. align-items: center;
  681. position: absolute;
  682. top: 0;
  683. right: 0;
  684. width: 60upx;
  685. height: 60upx;
  686. font-size: 34upx;
  687. color: #c0c0c0;
  688. }
  689. input {
  690. padding-left: 28upx;
  691. height: 28upx;
  692. font-size: 28upx;
  693. }
  694. }
  695. }
  696. .place {
  697. background-color: #ffffff;
  698. height: 100upx;
  699. /* #ifdef APP-PLUS */
  700. margin-top: var(--status-bar-height);
  701. /* #endif */
  702. }
  703. .category-list {
  704. width: 100%;
  705. background-color: #fff;
  706. display: flex;
  707. .left,
  708. .right {
  709. position: absolute;
  710. top: 190upx;
  711. /* #ifdef APP-PLUS */
  712. top: calc(100upx + var(--status-bar-height));
  713. /* #endif */
  714. bottom: 0upx;
  715. }
  716. .left {
  717. width: 24%;
  718. left: 0upx;
  719. background-color: #f2f2f2;
  720. .row {
  721. width: 100%;
  722. height: 90upx;
  723. display: flex;
  724. align-items: center;
  725. .text {
  726. width: 100%;
  727. position: relative;
  728. font-size: 28upx;
  729. display: flex;
  730. justify-content: center;
  731. color: #3c3c3c;
  732. .block {
  733. position: absolute;
  734. width: 0upx;
  735. left: 0;
  736. }
  737. }
  738. &.on {
  739. height: 100upx;
  740. background-color: #fff;
  741. .text {
  742. font-size: 30upx;
  743. font-weight: 600;
  744. color: #2d2d2d;
  745. .block {
  746. width: 10upx;
  747. height: 80%;
  748. top: 10%;
  749. background-color: #4D9864;
  750. }
  751. }
  752. }
  753. }
  754. }
  755. .right {
  756. width: 76%;
  757. left: 24%;
  758. .good_list {
  759. display: flex;
  760. justify-content: space-around;
  761. padding: 15upx 0;
  762. border-bottom: 1upx #F0F0F0 solid;
  763. height: auto;
  764. .goodleft {
  765. width: 50%;
  766. padding: 10upx 0 10upx 15upx;
  767. image {
  768. width: 160upx;
  769. height: 160upx;
  770. border-radius: 15upx;
  771. }
  772. }
  773. .goodright {
  774. width: 100%;
  775. padding: 10upx 4%;
  776. display: -webkit-box;
  777. -webkit-box-orient: vertical;
  778. -webkit-line-clamp: 1;
  779. text-align: justify;
  780. overflow: hidden;
  781. font-size: 28upx;
  782. color: #747474;
  783. .cpmc{
  784. overflow:hidden;
  785. text-overflow:ellipsis;
  786. display:-webkit-box;
  787. -webkit-box-orient:vertical;
  788. -webkit-line-clamp:1;
  789. }
  790. .sdtext {
  791. padding: 2upx 8upx;
  792. border: 1upx #DBDBDB solid;
  793. border-radius: 5upx;
  794. color: #B9B9B9;
  795. font-size: 25upx;
  796. margin-top: 3upx;
  797. }
  798. .sellnum {
  799. font-size: 25upx;
  800. padding-left: 15upx;
  801. color: #B9B9B9;
  802. }
  803. .miaos {
  804. width: 100%;
  805. margin: 10upx;
  806. display: -webkit-box;
  807. -webkit-box-orient: vertical;
  808. -webkit-line-clamp: 1;
  809. text-align: justify;
  810. overflow: hidden;
  811. font-size: 28upx;
  812. color: #747474;
  813. }
  814. .miaosshow {
  815. margin: 10upx;
  816. font-size: 28upx;
  817. color: #747474;
  818. }
  819. .rfoot {
  820. display: flex;
  821. justify-content: space-between;
  822. justify-items: center;
  823. padding-top: 8upx;
  824. }
  825. //收藏样式
  826. .p-b-btn {
  827. .yticon {
  828. font-size: 40upx;
  829. line-height: 48upx;
  830. color: $font-color-light;
  831. }
  832. &.active,
  833. &.active .yticon {
  834. color: $uni-color-primary;
  835. }
  836. .icon-fenxiang2 {
  837. font-size: 42upx;
  838. transform: translateY(-2upx);
  839. }
  840. .icon-shoucang {
  841. font-size: 50upx;
  842. }
  843. }
  844. }
  845. }
  846. .nosell {
  847. display: flex;
  848. justify-content: flex-end;
  849. text {
  850. position: relative;
  851. right: 5upx;
  852. padding: 5upx;
  853. background-color: #EAEAEA;
  854. color: white;
  855. font-size: 28upx !important;
  856. }
  857. }
  858. .number {
  859. display: flex;
  860. justify-content: flex-end;
  861. margin-right: 30upx;
  862. margin-bottom: 10upx;
  863. .input {
  864. width: 70upx;
  865. height: 45upx;
  866. margin: 0 10upx;
  867. // background-color: #f3f3f3;
  868. border-bottom: 1upx #ADADAD solid;
  869. input {
  870. width: 60upx;
  871. height: 60upx;
  872. display: flex;
  873. justify-content: center;
  874. align-items: center;
  875. text-align: center;
  876. font-size: 26upx;
  877. }
  878. }
  879. .sub,
  880. .add {
  881. width: 45upx;
  882. height: 45upx;
  883. border-radius: 5upx;
  884. }
  885. .jia {
  886. display: flex;
  887. width: 45upx;
  888. height: 45upx;
  889. justify-content: center;
  890. justify-items: center;
  891. align-items: center;
  892. background-color: #41A863;
  893. color: #fff;
  894. border-radius: 50%;
  895. image {
  896. width: 40upx;
  897. height: 40upx;
  898. padding: 7upx;
  899. }
  900. }
  901. .jian {
  902. display: flex;
  903. width: 45upx;
  904. height: 45upx;
  905. justify-content: center;
  906. justify-items: center;
  907. align-items: center;
  908. background-color: #41A863;
  909. color: #fff;
  910. border-radius: 50%;
  911. padding-bottom: 10upx;
  912. }
  913. }
  914. }
  915. }
  916. </style>