goods-classify.vue 27 KB

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