goods-classify.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. <template>
  2. <view class="container all-type-list-wrapper">
  3. <!-- 自定义顶部 -->
  4. <custom-floor :systeminfo='systeminfo' :navbar-data='nvabarData' :headerBtnPosi ="headerBtnPosi"></custom-floor>
  5. <view class="tui-header-screen" :style="{top:CustomBar+'px'}">
  6. <view class="tui-screen-top">
  7. <view class="tui-top-item" :class="[tabIndex ==0 ?'tui-active':'']" @tap="handleScreen" data-index="0">综合</view>
  8. <view class="tui-top-item tui-icon-ml" :class="[tabIndex==1?'tui-active':'']" data-index="1" @tap="handleScreen">
  9. <view>销量</view>
  10. <text class="iconfont icon-shangxiajiantou" v-if="isSearchSalesFirst"></text>
  11. <template v-else>
  12. <tui-icon :name="isSearchSales ? 'turningdown':'turningup'" :size="18" :color="tabIndex==1 ?'#e15616':'#999'" tui-icon-class="tui-ml"></tui-icon>
  13. </template>
  14. </view>
  15. <view class="tui-top-item tui-icon-ml" :class="[tabIndex==2?'tui-active':'']" data-index="2" @tap="handleScreen">
  16. <view>人气</view>
  17. <text class="iconfont icon-shangxiajiantou" v-if="isSearchMoodFirst"></text>
  18. <template v-else>
  19. <tui-icon :name="isSearchMood ? 'turningdown':'turningup'" :size="18" :color="tabIndex==2 ?'#e15616':'#999'" tui-icon-class="tui-ml"></tui-icon>
  20. </template>
  21. </view>
  22. <view class="tui-top-item tui-icon-ml" :class="[tabIndex==3?'tui-active':'']" data-index="3" @tap="handleScreen">
  23. <view>价格</view>
  24. <text class="iconfont icon-shangxiajiantou" v-if="isSearchPriceFirst"></text>
  25. <template v-else>
  26. <tui-icon :name="isSearchPrice ? 'turningdown':'turningup'" :size="18" :color="tabIndex==3?'#e15616':'#999'" tui-icon-class="tui-ml"></tui-icon>
  27. </template>
  28. </view>
  29. <view class="tui-top-item" @tap="handleScreen" data-index="4">
  30. <view>筛选</view>
  31. <text class="iconfont icon-shaixuan"></text>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- 商品列表 -->
  36. <list-skeleton v-if="showSkeleton" :listType='0'></list-skeleton>
  37. <template v-else>
  38. <view class="empty-container" v-if="showEmpty">
  39. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"></image>
  40. <text class="error-text">{{emptyText}}</text>
  41. </view>
  42. <template v-else>
  43. <view class="container-list" :style="{'height':scrollHeight+'px',paddingTop:(CustomBar+44)+'px'}">
  44. <view v-for="(item,index) in listData" :key="index" :id="item.productId" class="all-type-list-content commodity-list" @click.stop="navToDetailPage(item.productId)">
  45. <image mode='widthFix' :src="item.image" class="list-img" alt="list-img"></image>
  46. <view class="list-details-info">
  47. <text class="list-details-title">
  48. <text class="mclap-tag" v-if="item.beautyActFlag == 1">美博会</text>
  49. <text class="mclap" :class="item.beautyActFlag == 1 ? 'indent' : ''">{{ item.name }}</text>
  50. </text>
  51. <text class="list-details-specs">规格:{{item.unit}}</text>
  52. <view class="list-details-specs" v-if="item.code!=''&&item.code!=null">商品编码:{{item.code}}</view>
  53. <view class="list-details-price">
  54. <template v-if="userIdentity == 3">
  55. <view class="floor-item-act" v-if="item.actStatus==1">
  56. <view class="coupon-tags">优惠券</view>
  57. <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
  58. {{item.promotions.name}}<text v-if="item.priceFlag != 1 && item.supplierId === shopId">:¥{{ item.price | NumFormat }}</text>
  59. </view>
  60. <view class="floor-tags" v-else>{{item.promotions.name}}</view>
  61. </view>
  62. <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
  63. <view class="coupon-tags">优惠券</view>
  64. <view class="floor-tags">阶梯价格</view>
  65. </view>
  66. </template>
  67. <template v-else>
  68. <view class="floor-item-act" v-if="item.actStatus==1">
  69. <view class="coupon-tags">优惠券</view>
  70. <view class="floor-tags" v-if="PromotionsFormat(item.promotions)">
  71. {{item.promotions.name}}<text v-if="hasLogin && item.priceFlag != 1">:¥{{ item.price | NumFormat }}</text>
  72. </view>
  73. <view class="floor-tags" v-else>{{item.promotions.name}}</view>
  74. </view>
  75. <view class="floor-item-act" v-if="item.actStatus ==0 && item.ladderPriceFlag==1">
  76. <view class="coupon-tags">优惠券</view>
  77. <view class="floor-tags">阶梯价格</view>
  78. </view>
  79. </template>
  80. <view v-if="hasLogin" class="list-price">
  81. <template v-if="userIdentity == 1">
  82. <text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
  83. <template v-else>
  84. <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
  85. ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
  86. </text>
  87. </template>
  88. </template>
  89. <template v-if="userIdentity == 4">
  90. <view class="price-larger" v-if="item.priceFlag == 1">
  91. <text class="txt">¥未公开价格</text>
  92. </view>
  93. <view class="price-larger" v-if="item.priceFlag == 1">
  94. <text class="txt">¥价格仅会员可见</text>
  95. </view>
  96. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  97. <template v-else>
  98. <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
  99. ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
  100. </text>
  101. </template>
  102. </template>
  103. <template v-if="userIdentity == 3">
  104. <template v-if="item.supplierId === shopId">
  105. <view class="price-larger" v-if="item.priceFlag == 1">
  106. <text class="txt">¥未公开价格</text>
  107. </view>
  108. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  109. <text v-else class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
  110. ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
  111. </text>
  112. </template>
  113. <template v-else>
  114. <view class="list-login-now">
  115. <text class="p-no">¥</text>
  116. <uni-grader :grade="Number(item.priceGrade)"></uni-grader>
  117. </view>
  118. </template>
  119. </template>
  120. <template v-if="userIdentity == 2">
  121. <view class="price-larger" v-if="item.priceFlag == 1">
  122. <text class="txt">¥未公开价格</text>
  123. </view>
  124. <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
  125. <template v-else>
  126. <text class="price-larger" :class="PromotionsFormat(item.promotions) ? 'none' : ''">
  127. ¥{{ (PromotionsFormat(item.promotions) ? item.originalPrice : item.price) | NumFormat}}
  128. </text>
  129. </template>
  130. </template>
  131. </view>
  132. <view v-else class="list-login-now">
  133. <text class="p-no">¥</text>
  134. <uni-grader :grade="Number(item.priceGrade)"></uni-grader>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <!--加载loadding-->
  140. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  141. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  142. <!--加载loadding-->
  143. </view>
  144. </template>
  145. </template>
  146. <!--右抽屉-->
  147. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  148. <view class="drawer-container clearfix" :style="{paddingTop:CustomBar+'px'}">
  149. <view class="drawer-title">{{ classData.name }}</view>
  150. <view class="drawer-main">
  151. <template v-if="classData.smallTypeList">
  152. <view class="drawer-item-cell" v-for="(item,index) in classData.smallTypeList" :key="index">
  153. <view class="drawer-item-title">{{ item.name }}</view>
  154. <view class="drawer-item-main" v-if="item.tinyTypeList">
  155. <text class="drawer-item-text" :class="tiny.isChecked ? 'checked' : ''" v-for="(tiny,tinyIndex) in item.tinyTypeList" :key="tinyIndex" @click="SearchCondition(3,item,tiny)">{{ tiny.name }}</text>
  156. </view>
  157. <view class="drawer-item-main" v-else>
  158. <text class="drawer-item-text" :class="item.isChecked ? 'checked' : ''" @click="SearchCondition(2,item)">全部商品</text>
  159. </view>
  160. </view>
  161. </template>
  162. <template v-else>
  163. <view class="drawer-item-cell">
  164. <view class="drawer-item-main none">
  165. <text class="drawer-item-text" :class="classData.isChecked ? 'checked' : ''" @click="SearchCondition(1,classData)">全部商品</text>
  166. </view>
  167. </view>
  168. </template>
  169. </view>
  170. <view class="drawer-input btn" :style="{bottom :isIphoneX ? '68rpx' : '34rpx'}">
  171. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  172. <view class="drawer-btn comfrim" @click="handSearchList">确定</view>
  173. </view>
  174. </view>
  175. </tui-drawer>
  176. <!-- 透明模态层 -->
  177. <modal-layer v-if='isModallayer'></modal-layer>
  178. </view>
  179. </template>
  180. <script>
  181. import { mapState,mapMutations} from 'vuex';
  182. import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
  183. import customFloor from '@/components/cm-custom/custom-floor' //自定义导航
  184. import uniGrader from '@/components/uni-grade/uni-grade.vue'
  185. import modalLayer from "@/components/modal-layer"
  186. import authorize from '@/common/config/authorize.js'
  187. import wxLogin from "@/common/config/wxLogin.js"
  188. const defaultListQuery = {
  189. id:0,
  190. identity:0,
  191. pageNum:1,
  192. pageSize:10,
  193. sortField:'',
  194. sortType:1,
  195. idType:0,//一级
  196. };
  197. export default{
  198. components:{
  199. customFloor,
  200. listSkeleton,
  201. uniGrader,
  202. modalLayer
  203. },
  204. data(){
  205. return{
  206. shopId:0,
  207. tabIndex:0,
  208. isModallayer:false,
  209. isSearchSalesFirst:true,
  210. isSearchMoodFirst:true,
  211. isSearchPriceFirst:true,
  212. isSearchSales:true,
  213. isSearchMood:true,
  214. isSearchPrice:true,
  215. headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
  216. systeminfo: this.setSysteminfo(), //获取设备信息
  217. CustomBar:this.CustomBar,// 顶部导航栏高度
  218. isIphoneX:this.$store.state.isIphoneX,
  219. emptyText: '该分类暂时还没有商品哟,去逛逛别的吧~',
  220. isRequest:false,
  221. showSkeleton: true,
  222. showEmpty: false,
  223. userId: 0,
  224. userIdentity:'',
  225. listData: [],
  226. windowHeight: '',
  227. scrollHeight: '',
  228. listQuery:Object.assign({}, defaultListQuery),
  229. priceLoading:true,
  230. loadding: false,
  231. pullUpOn: true,
  232. pullFlag: true,
  233. totalPage: 0,
  234. nomoreText: '上拉显示更多',
  235. rightDrawer: false,
  236. classifyType:0,
  237. classData:{},
  238. searchCheckedId:null
  239. }
  240. },
  241. computed: {
  242. ...mapState(['hasLogin','userInfo','identity','isWxAuthorize'])
  243. },
  244. onLoad(option) {
  245. console.log(option)
  246. if(option.type =='share'){
  247. wxLogin.wxLoginAuthorize()
  248. }
  249. this.SetScrollHeight()
  250. this.InitOption(option)
  251. },
  252. filters: {
  253. NumFormat:function(text) {//处理金额
  254. return Number(text).toFixed(2);
  255. },
  256. },
  257. methods:{
  258. InitOption(option) {
  259. this.listQuery.id = option.id;
  260. this.listQuery.identity = this.identity;
  261. this.listQuery.idType = this.classifyType = Number(option.classType);
  262. uni.setNavigationBarTitle({title:option.title});
  263. this.$api.getComStorage('userInfo').then((resolve) =>{
  264. this.userId = resolve.userId ? resolve.userId : 0
  265. this.shopId = resolve.shopId ? resolve.shopId : 0
  266. this.userIdentity = resolve.userIdentity
  267. this.isRequest = true
  268. this.GetProductListInfo()
  269. this.GetProductOneClassly()
  270. }).catch(error =>{
  271. this.GetProductListInfo()
  272. this.GetProductOneClassly()
  273. })
  274. console.log(this.classifyID)
  275. },
  276. GetProductOneClassly(){//根据分类ID 查询二三级分类
  277. this.CommonService.GetProductOneClassly(
  278. {
  279. typeId:this.listQuery.id,
  280. idType:this.classifyType,
  281. source :'crm',
  282. }
  283. )
  284. .then(response =>{
  285. this.classData = response.data
  286. })
  287. .catch(error =>{
  288. this.$util.msg(error.msg,2000)
  289. })
  290. },
  291. GetProductListInfo(){//查询分类商品列表
  292. this.listQuery.pageNum = 1
  293. this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
  294. const resData = JSON.parse(response.data);
  295. const resList = resData.items;
  296. this.showSkeleton = false
  297. if(resList && resList.length > 0){
  298. this.showEmpty = false
  299. this.totalPage = resData.total;
  300. this.listData = [...resList];
  301. this.GetProductPrice()
  302. // 防上拉暴滑
  303. this.pullFlag = false;
  304. setTimeout(()=>{ this.pullFlag = true; },500)
  305. // 底部提示文案
  306. if(this.totalPage>this.listData.length) {
  307. this.pullUpOn = false
  308. this.nomoreText = '上拉显示更多'
  309. } else {
  310. if(this.listData.length>4){
  311. this.pullUpOn = false
  312. this.loadding = false
  313. this.nomoreText = '已至底部'
  314. }else{
  315. this.pullUpOn = true
  316. this.loadding = false
  317. this.nomoreText = '已至底部'
  318. }
  319. }
  320. console.log(this.listData)
  321. } else {
  322. this.showEmpty = true;
  323. }
  324. }).catch(error =>{
  325. this.$util.msg(error.msg,2000);
  326. })
  327. },
  328. GetOnReachBottomData(){//上拉加载
  329. this.listQuery.pageNum += 1
  330. this.ProductService.GetSearchProductTypeData(this.listQuery).then(response =>{
  331. const resData = JSON.parse(response.data);
  332. const resList = resData.items;
  333. this.totalPage = resData.total;
  334. this.listData = [...this.listData,...resList];
  335. this.GetProductPrice()
  336. // 防上拉暴滑
  337. this.pullFlag = false;
  338. setTimeout(()=>{ this.pullFlag = true; },500)
  339. // 底部提示文案
  340. if(this.totalPage>this.listData.length) {
  341. this.pullUpOn = false
  342. this.nomoreText = '上拉显示更多'
  343. } else {
  344. this.pullUpOn = false
  345. this.loadding = false
  346. this.nomoreText = '已至底部'
  347. }
  348. }).catch(error =>{
  349. this.$util.msg(error.msg,2000);
  350. })
  351. },
  352. GetProductPrice(){//获取价格
  353. let productIdArr = [];
  354. this.listData.map(item=>{// 0公开价格 1不公开价格 2仅对会员机构公开
  355. productIdArr.push(item.productId)
  356. })
  357. this.priceLoading = true;
  358. this.productIds = productIdArr.join(",");
  359. this.ProductService.querySearchProductPrice({userId: this.userId,productIds:this.productIds}).then(response =>{
  360. if(response.data) {
  361. this.listData = this.ReturnNewProducts(this.listData,response.data);
  362. }
  363. this.priceLoading = false;
  364. }).catch(error =>{
  365. this.$util.msg(error.msg,2000)
  366. })
  367. },
  368. ReturnNewProducts(Array,list){//处理对应商品ID的商品价格
  369. let NewArray = []
  370. Array.map(item=>{
  371. for (let i = 0; i < list.length; i++) {
  372. if( item.productId == list[i].productId ){
  373. NewArray.push(Object.assign(item,list[i]))
  374. }
  375. }
  376. });
  377. return NewArray
  378. },
  379. handleScreen(e) {
  380. let index = e.currentTarget.dataset.index;
  381. console.log(index)
  382. if (index == 0) {
  383. this.tabIndex = 0
  384. this.isSearchSalesFirst = true
  385. this.isSearchMoodFirst = true
  386. this.isSearchPriceFirst = true
  387. this.listQuery.sortType = 1
  388. this.listQuery.sortField = ''
  389. } else if (index == 1) {
  390. this.tabIndex = 1
  391. this.isSearchSalesFirst = false
  392. this.isSearchMoodFirst = true
  393. this.isSearchPriceFirst = true
  394. this.isSearchSales = !this.isSearchSales
  395. if(this.isSearchSales){
  396. this.listQuery.sortType = 1
  397. }else{
  398. this.listQuery.sortType = 0
  399. }
  400. this.listQuery.sortField = 'p_sales'
  401. } else if (index == 2) {
  402. this.tabIndex = 2
  403. this.isSearchSalesFirst = true
  404. this.isSearchPriceFirst = true
  405. this.isSearchMoodFirst= false
  406. this.isSearchMood = !this.isSearchMood
  407. if(this.isSearchMood){
  408. this.listQuery.sortType = 1
  409. }else{
  410. this.listQuery.sortType = 0
  411. }
  412. this.listQuery.sortField = 'p_favorite'
  413. } else if (index == 3) {
  414. this.tabIndex = 3
  415. this.isSearchSalesFirst = true
  416. this.isSearchMoodFirst = true
  417. this.isSearchPriceFirst= false
  418. this.isSearchPrice = !this.isSearchPrice
  419. if(this.isSearchPrice){
  420. this.listQuery.sortType = 1
  421. }else{
  422. this.listQuery.sortType = 0
  423. }
  424. this.listQuery.sortField = 'p_price'
  425. } else if (index == 4) {
  426. this.searchClickFn()
  427. }
  428. this.GetProductListInfo()
  429. },
  430. handSearchList(){//确定筛选
  431. if(this.searchCheckedId == ''){
  432. this.listQuery.id = this.classData.bigTypeID
  433. }else{
  434. this.listQuery.id = this.searchCheckedId
  435. }
  436. this.leftDrawer = false;
  437. this.rightDrawer = false;
  438. this.GetProductListInfo()
  439. },
  440. SearchCondition(type,item,tiny){//选择筛选分类
  441. this.listQuery.idType = type;
  442. const { classData, classData: { smalltypeList } } = this;
  443. classData.isChecked = false;
  444. if(smalltypeList && smalltypeList.length > 0) {
  445. smalltypeList.forEach((item, index) => {
  446. item.isChecked = false;
  447. const { tinytypeList } = item;
  448. if(tinytypeList && tinytypeList.length > 0) {
  449. tinytypeList.forEach((tinyItem, tinyIndex) => {
  450. tinyItem.isChecked = false;
  451. })
  452. }
  453. });
  454. }
  455. switch(type){
  456. case 1:
  457. console.log('1级分类全部商品',item);
  458. item.isChecked = !item.isChecked
  459. this.searchCheckedId = item.bigTypeId
  460. break;
  461. case 2:
  462. console.log('2级分类全部商品',item);
  463. item.isChecked = !item.isChecked
  464. if(item.isChecked){
  465. this.searchCheckedId = item.smallTypeId
  466. }else{
  467. this.searchCheckedId = ''
  468. }
  469. break;
  470. case 3:
  471. console.log('3级分类',tiny);
  472. tiny.isChecked = !tiny.isChecked
  473. if(tiny.isChecked){
  474. this.searchCheckedId = tiny.tinyTypeId
  475. }else{
  476. this.searchCheckedId = ''
  477. }
  478. break;
  479. }
  480. },
  481. navToDetailPage(id) {
  482. this.isModallayer = true;
  483. this.$api.navigateTo(`/pages/goods/product?id=${id}`);
  484. this.isModallayer = false;
  485. },
  486. PromotionsFormat(promo){//促销活动类型数据处理
  487. if(promo!=null){
  488. if(promo.type == 1 && promo.mode == 1){
  489. return true
  490. }else{
  491. return false
  492. }
  493. }
  494. return false
  495. },
  496. SetScrollHeight() {
  497. const {windowHeight, pixelRatio} = wx.getSystemInfoSync();
  498. this.windowHeight = windowHeight - 1;
  499. this.scrollHeight = windowHeight - 1;
  500. },
  501. setHeaderBtnPosi(){
  502. // 获得胶囊按钮位置信息
  503. let headerBtnPosi = uni.getMenuButtonBoundingClientRect();
  504. return headerBtnPosi
  505. },
  506. searchClickFn() {//弹出抽屉
  507. this.rightDrawer = true;
  508. },
  509. closeDrawer(e) {//关闭抽屉
  510. this.leftDrawer = false;
  511. this.rightDrawer = false;
  512. },
  513. setSysteminfo(){
  514. let systeminfo;
  515. uni.getSystemInfo({ // 获取设备信息
  516. success: (res) => {
  517. systeminfo = res
  518. },
  519. })
  520. return systeminfo
  521. },
  522. },
  523. onPullDownRefresh() {
  524. setTimeout(() => {
  525. this.GetProductListInfo()
  526. uni.stopPullDownRefresh()
  527. }, 200)
  528. },
  529. onReachBottom() {
  530. if(this.totalPage>this.listData.length) {
  531. this.loadding = true
  532. this.pullUpOn = true
  533. this.GetOnReachBottomData()
  534. }
  535. },
  536. onShareAppMessage(res){//分享转发
  537. if (res.from === 'button') {
  538. // 来自页面内转发按钮
  539. }
  540. return {
  541. title: `点击查看“${this.classData.name}”相关的商品`,
  542. path: `pages/goods/goods-classify?type=share&classType=${this.classifyType}&id=${this.listQuery.id}&title=${this.classData.name}`
  543. }
  544. },
  545. onShow() {
  546. }
  547. }
  548. </script>
  549. <style lang="scss">
  550. page {
  551. background: #FFFFFF;
  552. .all-type-list-wrapper {
  553. display: flex;
  554. flex-direction: column;
  555. }
  556. }
  557. .container-list{
  558. width: 100%;
  559. height: auto;
  560. }
  561. .all-type-list-content {
  562. height: 216rpx;
  563. padding: 24rpx;
  564. background: #fff;
  565. margin-bottom: 2rpx;
  566. display: flex;
  567. flex-direction: row;
  568. box-sizing: content-box;
  569. .list-img {
  570. width: 210rpx;
  571. height: 218rpx !important;
  572. margin-right: 26rpx;
  573. border-radius: 10rpx;
  574. border: 2rpx solid #f3f3f3;
  575. }
  576. }
  577. .list-details-info {
  578. width: 466rpx;
  579. display: flex;
  580. flex-direction: column;
  581. font-size: 26rpx;
  582. position: relative;
  583. .list-details-title {
  584. position: relative;
  585. .mclap{
  586. line-height: 38rpx;
  587. text-overflow: ellipsis;
  588. overflow: hidden;
  589. display: -webkit-box;
  590. -webkit-line-clamp: 2;
  591. line-clamp: 2;
  592. -webkit-box-orient: vertical;
  593. &.indent{
  594. text-indent: 95rpx;
  595. }
  596. }
  597. .mclap-tag{
  598. display: block;
  599. width: 84rpx;
  600. height: 32rpx;
  601. background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
  602. border-radius: 4rpx 48rpx 4px 4px;
  603. line-height: 32rpx;
  604. font-size: $font-size-22;
  605. color: #FFFFFF;
  606. text-align: center;
  607. position: absolute;
  608. left: 0;
  609. top: 0;
  610. }
  611. }
  612. .list-details-specs {
  613. margin-top: 8rpx;
  614. color: #666666;
  615. }
  616. .list-details-miniQuantity {
  617. margin-top: 7rpx;
  618. }
  619. }
  620. .list-details-price {
  621. width: 100%;
  622. height: 54rpx;
  623. line-height: 54rpx;
  624. position: absolute;
  625. bottom: -10rpx;
  626. right: 0;
  627. .floor-item-act{
  628. height: 54rpx;
  629. text-align: center;
  630. box-sizing: border-box;
  631. float: right;
  632. padding: 11rpx 0;
  633. .coupon-tags{
  634. height: 32rpx;
  635. box-sizing: border-box;
  636. border-radius: 8rpx;
  637. background-color: #fff1eb;
  638. line-height: 28rpx;
  639. color: #f94b4b;
  640. text-align: center;
  641. display: inline-block;
  642. padding:0 10rpx;
  643. font-size: $font-size-20;
  644. border: 1px solid #f94b4b;
  645. float: left;
  646. margin-right: 12rpx;
  647. }
  648. .floor-tags{
  649. height: 32rpx;
  650. box-sizing: border-box;
  651. border-radius: 8rpx;
  652. background-color: #FFFFFF;
  653. line-height: 28rpx;
  654. color: $color-system;
  655. text-align: center;
  656. display: inline-block;
  657. padding:0 16rpx;
  658. font-size: $font-size-20;
  659. border: 1px solid #E15616;
  660. float: left;
  661. }
  662. }
  663. .price-icon {
  664. width: 22rpx;
  665. height: 28rpx;
  666. vertical-align: middle;
  667. margin-right: 10rpx;
  668. }
  669. .price-icon + text {
  670. font-size: 25rpx;
  671. vertical-align: middle;
  672. }
  673. .list-login-now {
  674. color: #F8C499;
  675. float: left;
  676. line-height: 54rpx;
  677. .p-no{
  678. float: left;
  679. font-size: $font-size-24;
  680. color: $text-color;
  681. }
  682. }
  683. .login-now {
  684. padding: 10rpx 10rpx 10rpx 0;
  685. }
  686. .list-price {
  687. color: #FF2A2A;
  688. height: 44rpx;
  689. float: left;
  690. .price-larger {
  691. width: 100%;
  692. height: 44rpx;
  693. font-size: 32rpx;
  694. &.none{
  695. text-decoration: line-through;
  696. color: #999999;
  697. }
  698. &.small{
  699. font-size: $font-size-24;
  700. }
  701. .txt{
  702. font-size: $font-size-24;
  703. display: inline-block;
  704. line-height: 44rpx;
  705. text-align: left;
  706. float: left;
  707. }
  708. }
  709. }
  710. .add-cart-btn {
  711. width: 156rpx;
  712. height: 64rpx;
  713. line-height: 64rpx;
  714. border-radius: 32rpx;
  715. color: #fff;
  716. font-size: 26rpx;
  717. margin-right: 0;
  718. background:linear-gradient(45deg,rgba(255,41,41,1) 0%,rgba(255,109,27,1) 100%);
  719. }
  720. }
  721. /*screen*/
  722. .tui-header-screen {
  723. width: 100%;
  724. box-sizing: border-box;
  725. background: #fff;
  726. position: fixed;
  727. z-index: 1000;
  728. /* padding-top: 12rpx; */
  729. }
  730. .tui-screen-top,
  731. .tui-screen-bottom {
  732. display: flex;
  733. align-items: center;
  734. justify-content: space-between;
  735. font-size: 28rpx;
  736. color: #999999;
  737. }
  738. .tui-screen-top {
  739. height: 88rpx;
  740. position: relative;
  741. background: #fff;
  742. border-bottom: 1px solid #EFEFEF;
  743. }
  744. .tui-top-item {
  745. height: 28rpx;
  746. line-height: 28rpx;
  747. flex: 1;
  748. display: flex;
  749. align-items: center;
  750. justify-content: center;
  751. }
  752. .icon-shangxiajiantou{
  753. font-size: 20rpx;
  754. color: #999999;
  755. margin-left: 8rpx;
  756. }
  757. .tui-topitem-active {
  758. color: #e15616;
  759. }
  760. .tui-screen-bottom {
  761. height: 100rpx;
  762. padding: 0 30rpx;
  763. box-sizing: border-box;
  764. font-size: 24rpx;
  765. align-items: center;
  766. overflow: hidden;
  767. }
  768. .tui-bottom-text {
  769. line-height: 26rpx;
  770. max-width: 82%;
  771. white-space: nowrap;
  772. overflow: hidden;
  773. text-overflow: ellipsis;
  774. }
  775. .tui-bottom-item {
  776. flex: 1;
  777. width: 0;
  778. display: flex;
  779. align-items: center;
  780. justify-content: center;
  781. padding: 0 12rpx;
  782. box-sizing: border-box;
  783. background: #f7f7f7;
  784. margin-right: 20rpx;
  785. white-space: nowrap;
  786. height: 60rpx;
  787. border-radius: 40rpx;
  788. }
  789. .tui-bottom-item:last-child {
  790. margin-right: 0;
  791. }
  792. .tui-btmItem-active {
  793. background: #fcedea !important;
  794. color: #e15616;
  795. font-weight: bold;
  796. position: relative;
  797. }
  798. .tui-btmItem-active::after {
  799. content: "";
  800. position: absolute;
  801. border: 1rpx solid #e15616;
  802. width: 100%;
  803. height: 100%;
  804. border-radius: 40rpx;
  805. left: 0;
  806. top: 0;
  807. }
  808. .tui-btmItem-tap {
  809. position: relative;
  810. border-bottom-left-radius: 0;
  811. border-bottom-right-radius: 0;
  812. }
  813. .tui-btmItem-tap::after {
  814. content: "";
  815. position: absolute;
  816. width: 100%;
  817. height: 22rpx;
  818. background: #f7f7f7;
  819. left: 0;
  820. top: 58rpx;
  821. }
  822. .tui-active {
  823. color: #e15616;
  824. }
  825. .tui-icon-ml .tui-icon-class {
  826. margin-left: 6rpx;
  827. }
  828. .tui-ml {
  829. margin-left: 6rpx;
  830. }
  831. .tui-seizeaseat-20 {
  832. height: 20rpx;
  833. }
  834. .tui-seizeaseat-30 {
  835. height: 30rpx;
  836. }
  837. .tui-icon-middle .tui-icon-class {
  838. vertical-align: middle;
  839. }
  840. .tui-middle {
  841. vertical-align: middle;
  842. }
  843. /*screen*/
  844. .drawer-container {
  845. width: 560rpx;
  846. height: 100%;
  847. padding: 80rpx 0;
  848. box-sizing: border-box;
  849. .drawer-title{
  850. width: 100%;
  851. height: 72rpx;
  852. line-height: 72rpx;
  853. box-sizing: border-box;
  854. padding: 0 30rpx;
  855. text-align: left;
  856. font-size: $font-size-26;
  857. color: #e15616;
  858. font-weight: bold;
  859. background-color: #F7F7F7;
  860. }
  861. .drawer-main{
  862. width: 100%;
  863. height: auto;
  864. box-sizing: border-box;
  865. padding: 0 30rpx;
  866. .drawer-item-cell{
  867. width: 100%;
  868. height: auto;
  869. float: left;
  870. .drawer-item-title{
  871. width: 100%;
  872. height: 82rpx;
  873. line-height: 82rpx;
  874. text-align: left;
  875. font-size: $font-size-26;
  876. color: $text-color;
  877. float: left;
  878. }
  879. .drawer-item-main{
  880. width: 100%;
  881. height: auto;
  882. float: left;
  883. &.none{
  884. margin-top: 24rpx;
  885. }
  886. .drawer-item-text{
  887. display: inline-block;
  888. float: left;
  889. padding: 0 30rpx;
  890. height: 56rpx;
  891. border-radius: 28rpx;
  892. background-color: #F7F7F7;
  893. line-height: 56rpx;
  894. text-align: center;
  895. color: #999999;
  896. font-size: $font-size-26;
  897. margin-right: 24rpx;
  898. margin-bottom: 24rpx;
  899. &.checked{
  900. background-color: #fef6f3;
  901. color: $color-system;
  902. }
  903. }
  904. }
  905. }
  906. }
  907. .drawer-input{
  908. width: 100%;
  909. height: 80rpx;
  910. float: left;
  911. box-sizing: border-box;
  912. padding: 0 10rpx;
  913. border: 1px solid rgba(0,0,0,0.2);
  914. border-radius: 4rpx;
  915. margin-bottom: 30rpx;
  916. position: relative;
  917. &.btn{
  918. border: none;
  919. margin-top: 40rpx;
  920. display: flex;
  921. position: absolute;
  922. left: 0;
  923. }
  924. .drawer-btn{
  925. width: 210rpx;
  926. height: 84rpx;
  927. border-radius: 42rpx;
  928. background: $btn-confirm;
  929. line-height: 84rpx;
  930. text-align: center;
  931. font-size: $font-size-26;
  932. color: #FFFFFF;
  933. flex: 1;
  934. margin: 0 10rpx;
  935. &.comfrim{
  936. background: $btn-confirm;
  937. }
  938. &.clear{
  939. background: #e1e1e1;
  940. }
  941. }
  942. }
  943. }
  944. </style>