index.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. <template>
  2. <view :data-theme="theme">
  3. <view class='productList'>
  4. <view class='search bg_color acea-row row-between-wrapper'>
  5. <!-- #ifdef H5 -->
  6. <view class="iconfont icon-xiangzuo" @click="goback()"></view>
  7. <!-- #endif -->
  8. <view :class="tabIndex !== 2?'searchIpt':''" class='input acea-row row-middle'><text class='iconfont icon-sousuo mr20'></text>
  9. <input :placeholder="tabIndex===1?'搜索商品名称':'搜索店铺名称'" placeholder-class='placeholder' confirm-type='search' name="search"
  10. v-model="keyword" @confirm="searchSubmit" maxlength="20"></input>
  11. </view>
  12. <view v-if="tabIndex === 2" class='iconfont icon-shaixuan' @click='open(2)'></view>
  13. </view>
  14. <view class="nav-wrapper mr-20px" v-if="merId===0 && cid === 0">
  15. <view class="tab-bar" :class="{'merTab':tabIndex===2}">
  16. <view class="tab-item" :class="{on:tabIndex===1}" @click="changetab(1)">商品</view>
  17. <view class="tab-item" :class="{on:tabIndex===2}" @click="changetab(2)">店铺</view>
  18. </view>
  19. </view>
  20. <view v-if="tabIndex===1" class='nav acea-row row-middle flex-between-center' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
  21. <view class='item' :class='title ? "font_color":""' @click='set_where(1,tabIndex)'>
  22. {{title ? title:'默认'}}
  23. </view>
  24. <view class='item' @click='set_where(2,tabIndex)'>
  25. 价格
  26. <image v-if="price==1" :src='upPng'></image>
  27. <image v-else-if="price==2" :src='downPng'></image>
  28. <image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
  29. </view>
  30. <template v-if="!flowType">
  31. <view class='item-c item' @click='set_where(3,tabIndex)'>
  32. 销量
  33. <image v-if="stock==1" :src='upPng'></image>
  34. <image v-else-if="stock==2" :src='downPng'></image>
  35. <image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
  36. </view>
  37. <!-- down -->
  38. <view class="item-shu"></view>
  39. <view class='item-icon iconfont' :class="is_switch?'icon-pailie':'icon-tupianpailie'" @click='Changswitch()'>
  40. </view>
  41. </template>
  42. <view class='item' v-else>
  43. <view class="flex-center" @tap="showCateDrawer = !showCateDrawer">
  44. <text>{{'预览' + rangeArr[tabActive].name}}</text>
  45. <view class="w-76 h-100 flex-center topic-box">
  46. <text class="iconfont fs-24" :class="!showCateDrawer?'icon-xiala3':'icon-xiangshang2'"></text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 话题分类下拉 -->
  52. <view class="fixed-lt w-full bg--w111-fff rd-b-24rpx z-100 pt-22" v-if="showCateDrawer"
  53. :style="{top: (86+86) + 'rpx'}">
  54. <view class="w-full pr-20 pb-30 pl-30">
  55. <view>
  56. <view :class="tabActive == item.id ? 'bg-color-good' : ''" v-for="(item, index) of rangeArr" :key="index"
  57. class="flex-between-center h-40 mb-20" @click="tabActiveClick(item)">
  58. 预览{{item.name}}
  59. <text v-if="tabActive == item.id" class="iconfont icon-gou"></text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view :style="{top: (86+86) + 'rpx'}" class="mask z-80" v-if="showCateDrawer" @tap="()=>{showCateDrawer = false}"></view>
  65. <view v-if="tabIndex===1" :class="is_switch==true?'proList':'listBox'">
  66. <view :class="[(merId > 0 || cid > 0) ? 'mer-listBox' : '']" v-if="productList.length>0">
  67. <view v-if="!is_switch" class='list acea-row row-between-wrapper' :class="[is_switch==true ? '' : 'on', (merId > 0 || cid > 0) ? 'mer-list' : ''] ">
  68. <view class='item' :class='is_switch==true?"":"on"' hover-class='none' v-for="(item,index) in productList" :key="index"
  69. @click="godDetail(item)">
  70. <view class='pictrue' :class='is_switch==true?"":"on"'>
  71. <view v-show="item.stock===0" class="sellOut">已售罄</view>
  72. <easy-loadimage :image-src="item.image" :class='is_switch==true?"":"on"'>
  73. </easy-loadimage>
  74. <span class="pictrue_log_class" :class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'" v-if="item.activityH5 && item.activityH5.type === '1'">秒杀</span>
  75. <span class="pictrue_log_class" :class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'" v-if="item.activityH5 && item.activityH5.type === '2'">砍价</span>
  76. <span class="pictrue_log_class" :class="is_switch === true ? 'pictrue_log_big' : 'pictrue_log'" v-if="item.activityH5 && item.activityH5.type === '3'">拼团</span>
  77. </view>
  78. <view class='text' :class='is_switch==true?"":"on"'>
  79. <view class='name box-line2 mb-10'>
  80. <span v-if="item.productTags && item.productTags.locationLeftTitle.length" class="font-bg-red mr10 merType bg-color">{{item.productTags.locationLeftTitle[0].tagName}}</span>
  81. {{item.name}}
  82. </view>
  83. <!-- 价格 -->
  84. <svip-price :svipIconStyle="svipIconStyle" :productPrice="item" :svipPriceStyle="svipPriceStyle"></svip-price>
  85. <view v-if="item.productTags && item.productTags.locationUnderTitle.length">
  86. <text v-for="items in item.productTags.locationUnderTitle.length>3?item.productTags.locationUnderTitle.slice(0,3):item.productTags.locationUnderTitle"
  87. class="mr10 tagSolid">{{items.tagName}}</text>
  88. </view>
  89. <view class='vip acea-row row-between-wrapper mt-10 mb-10' :class='is_switch==true?"":"on"'>
  90. <view>已售{{item.sales}}{{item.unitName}}</view>
  91. </view>
  92. <view v-if="item.merName" class="company" @click.stop="goStore(item.merId)">
  93. <text class='name line1'>{{item.merName}}</text>
  94. <view class="flex">
  95. 进店
  96. <text class="iconfont icon-xiangyou"></text>
  97. </view>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. <view v-else class="goods">
  103. <WaterfallsFlow :wfList='productList' :isDynamics="flowType" :userFair="flowType" :type="1">
  104. <template slot-scope="{item}">
  105. <WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
  106. </template>
  107. </WaterfallsFlow>
  108. </view>
  109. </view>
  110. <view class='loadingicon acea-row row-center-wrapper'>
  111. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{productList.length>0?loadTitle:''}}
  112. </view>
  113. </view>
  114. <view class="merList" v-if="tabIndex == 2">
  115. <view v-if="merchantList.length===0" style="background-color: #F5F5F5;" class='nav acea-row row-middle' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
  116. </view>
  117. <merchant-list :merchantList="merchantList"></merchant-list>
  118. <view class='loadingicon acea-row row-center-wrapper'>
  119. <text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>
  120. </view>
  121. </view>
  122. </view>
  123. <view class='noCommodity' :class="{'mer-mt194': tabIndex ==2, 'mer-mt100': cid !== 0}" :style="{'top':!is_switch?'-110rpx':''}"
  124. v-if="(productList.length==0 && isShow && tabIndex===1 && !loading ) || (merchantList.length==0 && isShow && tabIndex===2 && !loading)">
  125. <view class='pictrue'>
  126. <image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
  127. </view>
  128. <text class="text-ccc">{{tabIndex===1?'暂无商品~':'暂无店铺~'}}</text>
  129. <recommend v-if="!merId || !fairCateId" ref="recommendIndex" class="mt-40"></recommend>
  130. <recommend v-if="fairCateId" :dynamics="true" :tabActive="tabActive" ref="recommendIndex" class="mt-40"></recommend>
  131. </view>
  132. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  133. <merSeach :whereMer="whereMer" @close="closeDrawer" @confirm="confirm"></merSeach>
  134. </tui-drawer>
  135. </view>
  136. </template>
  137. <script>
  138. // +----------------------------------------------------------------------
  139. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  140. // +----------------------------------------------------------------------
  141. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  142. // +----------------------------------------------------------------------
  143. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  144. // +----------------------------------------------------------------------
  145. // | Author: CRMEB Team <admin@crmeb.com>
  146. // +----------------------------------------------------------------------
  147. import {
  148. productList
  149. } from '@/api/product.js';
  150. import {
  151. getMerSearchApi,
  152. getMerProListApi,
  153. getSecondHandListApi
  154. } from '@/api/merchant.js';
  155. import {
  156. mapGetters
  157. } from "vuex";
  158. import {
  159. goProductDetail
  160. } from '@/libs/order.js'
  161. import merSeach from '../components/merSeach/index.vue'
  162. import merchantList from '@/components/merchantList/index.vue'
  163. import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
  164. import tuiDrawer from '../components/tui-drawer/index.vue'
  165. import recommend from "@/components/base/recommend.vue";
  166. import easyLoadimage from '@/components/base/easy-loadimage.vue';
  167. import WaterfallsFlowItem from '@/components/WaterfallsFlowItem/WaterfallsFlowItem.vue'
  168. import svipPrice from '@/components/svipPrice.vue';
  169. let app = getApp();
  170. export default {
  171. computed: mapGetters(['uid']),
  172. components: {
  173. merchantList,
  174. merSeach,
  175. WaterfallsFlow,
  176. tuiDrawer,
  177. recommend,
  178. easyLoadimage,
  179. WaterfallsFlowItem,
  180. svipPrice
  181. },
  182. mounted() {
  183. this.$store.dispatch('MerCategoryList');
  184. this.$store.dispatch('MerTypeList');
  185. },
  186. data() {
  187. return {
  188. //普通价格
  189. svipPriceStyle: {
  190. svipBox: {
  191. height: '26rpx',
  192. borderRadius: '60rpx 56rpx 56rpx 20rpx',
  193. },
  194. icon: {
  195. height: '26rpx',
  196. fontSize: '18rpx',
  197. borderRadius: '12rpx 0 12rpx 2rpx'
  198. },
  199. price: {
  200. fontSize: '38rpx'
  201. },
  202. svipPrice: {
  203. fontSize: '22rpx'
  204. }
  205. },
  206. //svip价格
  207. svipIconStyle: {
  208. svipBox: {
  209. height: '26rpx',
  210. borderRadius: '24rpx 40rpx 40rpx 0.4rpx',
  211. },
  212. price: {
  213. fontSize: '38rpx'
  214. },
  215. svipPrice: {
  216. fontSize: '18rpx'
  217. }
  218. },
  219. urlDomain: this.$Cache.get("imgHost"),
  220. keyword: '',
  221. rangeArr: [
  222. {id: 0, range: 'school', name: '本校'},
  223. {id: 1, range: 'school', name: '同城'},
  224. {id: 2, range: 'school', name: '全国'},
  225. ],
  226. rangeStr: '',
  227. tabActive: null,
  228. flowType: false,
  229. drawers: 0,
  230. tabIndex: 1,
  231. productList: [],
  232. is_switch: true,
  233. where: {
  234. latitude: uni.getStorageSync('user_latitude'),
  235. longitude: uni.getStorageSync('user_longitude'),
  236. keyword: '',
  237. priceOrder: '',
  238. salesOrder: '',
  239. //news: 0,
  240. page: 1,
  241. limit: 20,
  242. cid: '', //商城使用
  243. merId: '',
  244. cids: '' //商户使用
  245. },
  246. cid: 0, //分类id
  247. price: 0,
  248. stock: 0,
  249. nows: false,
  250. loadend: false,
  251. loading: false,
  252. loadTitle: '加载更多',
  253. title: '',
  254. theme: app.globalData.theme,
  255. upPng: '',
  256. downPng: '',
  257. whereMer: {
  258. latitude: uni.getStorageSync('user_latitude'),
  259. longitude: uni.getStorageSync('user_longitude'),
  260. categoryIds: '',
  261. isSelf: '',
  262. keywords: '',
  263. page: 1,
  264. limit: 20,
  265. typeIds: ''
  266. },
  267. rightDrawer: false,
  268. merchantList: [],
  269. merId: 0,
  270. cateId: null,
  271. goodScroll: true,
  272. isShow: false,
  273. fairCateId: '',
  274. showCateDrawer: false
  275. };
  276. },
  277. // 滚动监听
  278. onPageScroll(e) {
  279. // 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
  280. uni.$emit('scroll');
  281. },
  282. onLoad: function(options) {
  283. this.downPng = `${this.urlDomain}crmebimage/presets/down_red.png`;
  284. this.upPng = `${this.urlDomain}crmebimage/presets/up_red.png`;
  285. this.merId = options.merId ? Number(options.merId) : 0;
  286. this.cateId = options.cateId ? Number(options.cateId) : '';
  287. this.fairCateId = Number(options.fairCateId) || ''
  288. if (this.cateId) {
  289. uni.setNavigationBarTitle({
  290. title: '精选商品'
  291. });
  292. }
  293. this.$set(this, 'cid', Number(options.cid) || 0);
  294. this.title = options.title || '';
  295. if (this.fairCateId) {
  296. this.cid = 9999999999
  297. this.flowType = true
  298. this.$set(this, 'rangeStr', options.rangeStr || '');
  299. this.$set(this, 'tabActive', +options.tabActive);
  300. uni.setNavigationBarTitle({
  301. title: '二手交易'
  302. });
  303. }
  304. this.$set(this, 'keyword', options.searchValue || '');
  305. if (this.tabIndex === 1) this.get_product_list();
  306. switch (this.theme) {
  307. case 'theme2':
  308. this.upPng = `${this.urlDomain}crmebimage/presets/up_orange.png`;
  309. this.downPng = `${this.urlDomain}crmebimage/presets/down_orange.png`;
  310. break;
  311. case 'theme3':
  312. this.upPng = `${this.urlDomain}crmebimage/presets/up_green.png`;
  313. this.downPng = `${this.urlDomain}crmebimage/presets/down_green.png`;
  314. break;
  315. case 'theme4':
  316. this.upPng = `${this.urlDomain}crmebimage/presets/up_blue.png`;
  317. this.downPng = `${this.urlDomain}crmebimage/presets/down_blue.png`;
  318. break;
  319. case 'theme5':
  320. this.upPng = `${this.urlDomain}crmebimage/presets/up_pink.png`;
  321. this.downPng = `${this.urlDomain}crmebimage/presets/down_pink.png`;
  322. break;
  323. default:
  324. this.upPng = `${this.urlDomain}crmebimage/presets/up_red.png`;
  325. this.downPng = `${this.urlDomain}crmebimage/presets/down_red.png`;
  326. break;
  327. }
  328. console.log(this.productList, this.isShow, this.tabIndex, this.loading)
  329. },
  330. methods: {
  331. tabActiveClick(item) {
  332. this.tabActive = item.id;
  333. this.rangeStr = item.range;
  334. this.showCateDrawer = false;
  335. },
  336. goStore(id) {
  337. uni.navigateTo({
  338. url: `/pages/merchant/home/index?merId=${id}`
  339. })
  340. },
  341. confirm(data) {
  342. this.whereMer.typeIds = data.typeId;
  343. this.whereMer.categoryIds = data.categoryId;
  344. this.whereMer.keywords = this.where.keyword;
  345. this.loadend = false;
  346. this.$set(this.whereMer, 'page', 1)
  347. this.merchantList = [];
  348. this.rightDrawer = false
  349. this.getMerStreet();
  350. },
  351. changetab(n) {
  352. this.tabIndex = n;
  353. this.nows = 1;
  354. this.stock = 0;
  355. this.loadend = false;
  356. this.loading = false;
  357. if (n === 2) {
  358. this.merchantList = [];
  359. this.$set(this.whereMer, 'page', 1);
  360. this.getMerStreet();
  361. this.title = '';
  362. } else {
  363. this.whereMer.typeIds = '';
  364. this.whereMer.categoryIds = '';
  365. this.productList = [];
  366. this.$set(this.where, 'page', 1);
  367. this.get_product_list();
  368. }
  369. },
  370. open(n) {
  371. if (this.tabIndex === 2) {
  372. this.rightDrawer = true;
  373. this.drawers = n;
  374. }
  375. },
  376. closeDrawer(e) {
  377. this.rightDrawer = false
  378. if (!e) {
  379. this.rightDrawer = false
  380. }
  381. },
  382. goback() {
  383. // #ifdef H5
  384. return history.back();
  385. // #endif
  386. // #ifndef H5
  387. return uni.navigateBack({
  388. delta: 1,
  389. })
  390. // #endif
  391. },
  392. getMerStreet: function(isPage) {
  393. this.skeletonShow = true
  394. let that = this;
  395. that.setWhere();
  396. if (that.loadend) return;
  397. if (that.loading) return;
  398. that.loading = true;
  399. if (isPage === true) that.$set(that, 'merchantList', []);
  400. that.loadTitle = '';
  401. that.whereMer.keywords = encodeURIComponent(that.keyword);
  402. that.cateId ? that.whereMer.productType = that.cateId : '';
  403. getMerSearchApi(that.whereMer).then(res => {
  404. let list = res.data.list;
  405. let merchantList = that.$util.SplitArray(list, that.merchantList);
  406. let loadend = list.length < that.whereMer.limit;
  407. that.loadend = loadend;
  408. that.loadTitle = loadend ? '没有了' : '加载更多';
  409. that.$set(that, 'merchantList', merchantList);
  410. that.$set(that.whereMer, 'page', that.whereMer.page + 1);
  411. that.loading = false;
  412. this.skeletonShow = false;
  413. this.isShow = true
  414. }).catch(err => {
  415. that.loading = false;
  416. that.goodScroll = false;
  417. that.loadTitle = '加载更多';
  418. });
  419. },
  420. // 去详情页
  421. godDetail(item) {
  422. goProductDetail(item.id, 0, '');
  423. },
  424. Changswitch: function() {
  425. let that = this;
  426. that.is_switch = !that.is_switch
  427. },
  428. searchSubmit: function(e) {
  429. let that = this;
  430. that.loadend = false;
  431. that.$set(that, 'keyword', e.detail.value || '');
  432. if (that.tabIndex === 1) {
  433. that.$set(that.where, 'page', 1)
  434. this.get_product_list(true);
  435. } else {
  436. that.$set(that, 'merchantList', []);
  437. this.$set(this.whereMer, 'page', 1)
  438. this.getMerStreet();
  439. }
  440. },
  441. //点击事件处理
  442. set_where: function(e, n) {
  443. switch (e) {
  444. case 1:
  445. this.price = 0;
  446. this.stock = 0;
  447. break;
  448. case 2:
  449. if (this.price == 0) this.price = 1;
  450. else if (this.price == 1) this.price = 2;
  451. else if (this.price == 2) this.price = 0;
  452. this.stock = 0;
  453. break;
  454. case 3:
  455. if (this.stock == 0) this.stock = 1;
  456. else if (this.stock == 1) this.stock = 2;
  457. else if (this.stock == 2) this.stock = 0;
  458. this.price = 0
  459. break;
  460. case 4:
  461. this.price = 0;
  462. this.stock = 0;
  463. break;
  464. }
  465. if (n === 1) {
  466. this.loadend = false;
  467. this.$set(this.where, 'page', 1);
  468. this.get_product_list(true);
  469. } else {
  470. this.nows = 1;
  471. }
  472. },
  473. //设置where条件
  474. setWhere: function() {
  475. if (this.price == 0) this.where.priceOrder = '';
  476. else if (this.price == 1) this.where.priceOrder = 'asc';
  477. else if (this.price == 2) this.where.priceOrder = 'desc';
  478. if (this.stock == 0) this.where.salesOrder = '';
  479. else if (this.stock == 1) this.where.salesOrder = 'asc';
  480. else if (this.stock == 2) this.where.salesOrder = 'desc';
  481. //this.where.news = this.nows ? 1 : 0;
  482. },
  483. //查找产品
  484. get_product_list: function(isPage) {
  485. let that = this;
  486. that.setWhere();
  487. if (that.loadend) return;
  488. if (that.loading) return;
  489. if (isPage === true) that.$set(that, 'productList', []);
  490. that.loading = true;
  491. that.loadTitle = '';
  492. if (this.merId > 0) that.where.merId = that.merId
  493. that.where.keyword = encodeURIComponent(that.keyword);
  494. that.cateId ? that.where.productType = that.cateId : '';
  495. if (that.cid === 0) {
  496. that.where.cid = '';
  497. that.where.cids = '';
  498. } else {
  499. if (this.merId > 0) {
  500. that.where.cids = that.cid
  501. that.where.cid = '';
  502. } else {
  503. that.where.cid = that.cid;
  504. that.where.cids = ''
  505. }
  506. }
  507. if (this.fairCateId) {
  508. that.where.range = this.rangeStr
  509. if (that.where.range == 'city') {
  510. that.where.city = uni.getStorageSync('cityName')
  511. }
  512. that.where.categoryId = this.fairCateId
  513. console.log(this.where)
  514. getSecondHandListApi(that.where).then(res => {
  515. let list = res.data.list;
  516. let productList = that.$util.SplitArray(list, that.productList);
  517. let loadend = list.length < that.where.limit;
  518. that.loadend = loadend;
  519. that.loading = false;
  520. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  521. that.$set(that, 'productList', productList);
  522. that.$set(that.where, 'page', that.where.page + 1);
  523. this.isShow = true
  524. }).catch(err => {
  525. that.loading = false;
  526. that.loadTitle = '加载更多'
  527. })
  528. } else {
  529. this.merId === 0 ? productList(that.where).then(res => {
  530. let list = res.data.list;
  531. let productList = that.$util.SplitArray(list, that.productList);
  532. let loadend = list.length < that.where.limit;
  533. that.loadend = loadend;
  534. that.loading = false;
  535. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  536. that.$set(that, 'productList', productList);
  537. that.$set(that.where, 'page', that.where.page + 1);
  538. this.isShow = true
  539. }).catch(err => {
  540. that.loading = false;
  541. that.loadTitle = '加载更多'
  542. }) : getMerProListApi(that.where).then(res => {
  543. let list = res.data.list;
  544. let productList = that.$util.SplitArray(list, that.productList);
  545. let loadend = list.length < that.where.limit;
  546. that.loadend = loadend;
  547. that.loading = false;
  548. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  549. that.$set(that, 'productList', productList);
  550. that.$set(that.where, 'page', that.where.page + 1);
  551. this.isShow = true
  552. }).catch(err => {
  553. that.loading = false;
  554. that.loadTitle = '加载更多'
  555. })
  556. }
  557. },
  558. },
  559. onReachBottom() {
  560. console.log(1111111111111111)
  561. if (this.tabIndex === 2) {
  562. this.getMerStreet();
  563. }
  564. if (this.productList.length > 0) {
  565. this.get_product_list();
  566. }
  567. if ((this.productList.length == 0 && this.isShow && this.tabIndex === 1 && !this.loading) || (this.merchantList
  568. .length == 0 && this.isShow && this.tabIndex === 2 && !this.loading)) {
  569. this.$refs.recommendIndex.get_host_product();
  570. }
  571. }
  572. }
  573. </script>
  574. <style>
  575. body {
  576. height: auto !important;
  577. }
  578. </style>
  579. <style scoped lang="scss">
  580. .mt80 {
  581. margin-top: 80rpx;
  582. }
  583. .searchIpt {
  584. /* #ifdef H5 */
  585. width: 91% !important;
  586. /* #endif */
  587. /* #ifndef H5 */
  588. width: 100% !important;
  589. /* #endif */
  590. }
  591. .store-item .merTab {
  592. height: auto !important;
  593. .tab-item {
  594. margin-top: 8rpx !important;
  595. }
  596. }
  597. .text-ccc {
  598. text-align: center;
  599. display: block;
  600. }
  601. .company {
  602. display: flex;
  603. align-items: center;
  604. color: #737373 !important;
  605. font-size: 26rpx;
  606. .name {
  607. display: inline-block;
  608. // width: 120rpx;
  609. height: auto !important;
  610. overflow: hidden;
  611. white-space: nowrap;
  612. text-overflow: ellipsis;
  613. }
  614. .flex {
  615. display: flex;
  616. align-items: center;
  617. margin-left: 10rpx;
  618. color: #282828 !important;
  619. width: 100rpx;
  620. .iconfont {
  621. font-size: 16rpx;
  622. margin-top: 4rpx;
  623. }
  624. }
  625. }
  626. .icon-xiangzuo {
  627. color: #fff;
  628. }
  629. .goods {
  630. display: flex;
  631. flex-wrap: wrap;
  632. justify-content: space-between;
  633. padding-left: 24rpx;
  634. background-color: #F5F5F5;
  635. width: 100%;
  636. }
  637. .proList {
  638. margin-top: 256rpx;
  639. }
  640. .merList {
  641. position: relative;
  642. top: 154rpx;
  643. z-index: 66;
  644. }
  645. .merBox {
  646. /deep/.tui-drawer-container {
  647. width: 635rpx;
  648. }
  649. }
  650. .mer {
  651. &-nav {
  652. top: 80rpx !important;
  653. border-radius: inherit !important;
  654. }
  655. &-list {
  656. margin-top: 248rpx !important;
  657. }
  658. &-listBox {
  659. position: relative;
  660. top: -68rpx;
  661. }
  662. &-mt194 {
  663. margin-top: 260rpx !important;
  664. }
  665. &-mt100 {
  666. top: -200rpx !important;
  667. }
  668. }
  669. .no-shop {
  670. margin-top: 6rpx;
  671. background-color: #fff;
  672. padding-bottom: calc(100% - 109rpx);
  673. .pictrue {
  674. display: flex;
  675. flex-direction: column;
  676. align-items: center;
  677. //color: $uni-nothing-text;
  678. image {
  679. width: 414rpx;
  680. height: 380rpx;
  681. }
  682. }
  683. }
  684. .with50 {
  685. width: 50% !important;
  686. }
  687. .nav-wrapper {
  688. z-index: 9;
  689. position: fixed;
  690. left: 0;
  691. top: 86rpx;
  692. width: 100%;
  693. @include main_bg_color(theme);
  694. .tab-bar {
  695. display: flex;
  696. align-items: center;
  697. height: 131rpx;
  698. .tab-item {
  699. position: relative;
  700. flex: 1;
  701. display: flex;
  702. justify-content: center;
  703. align-items: center;
  704. padding-bottom: 40rpx;
  705. color: #fff;
  706. font-size: 28rpx;
  707. font-weight: bold;
  708. margin-top: -36rpx;
  709. &::after {
  710. content: ' ';
  711. position: absolute;
  712. left: 50%;
  713. bottom: 34rpx;
  714. width: 60rpx;
  715. height: 3rpx;
  716. background: transparent;
  717. transform: translateX(-50%);
  718. }
  719. &.on {
  720. &::after {
  721. background: #fff;
  722. }
  723. }
  724. }
  725. }
  726. }
  727. .bg_color {
  728. @include main_bg_color(theme);
  729. }
  730. .font_color {
  731. @include main_color(theme);
  732. }
  733. .x-money {
  734. font-size: 38rpx;
  735. font-weight: 900;
  736. @include price_color(theme);
  737. }
  738. .iconfont {
  739. //color: #fff;
  740. }
  741. .listBox {
  742. margin-top: 240rpx !important;
  743. background-color: #FFFFFF;
  744. }
  745. .fixed-top {
  746. position: fixed;
  747. top: 0;
  748. left: 0;
  749. z-index: 9;
  750. }
  751. .productList .search {
  752. width: 100%;
  753. height: 86rpx;
  754. padding: 0 30rpx;
  755. box-sizing: border-box;
  756. position: fixed;
  757. top: 0 !important;
  758. left: 0;
  759. z-index: 666;
  760. color: #fff;
  761. }
  762. .productList .search .input {
  763. width: 570rpx;
  764. height: 60rpx;
  765. background-color: #fff;
  766. border-radius: 50rpx;
  767. padding: 0 20rpx;
  768. box-sizing: border-box;
  769. color: #333;
  770. }
  771. .productList .search .input input {
  772. width: 88%;
  773. height: 100%;
  774. font-size: 26rpx;
  775. }
  776. .productList .search .input .placeholder {
  777. color: #CCCCCC;
  778. }
  779. .productList .search .input .iconfont {
  780. font-size: 26rpx;
  781. color: #999999;
  782. }
  783. .productList .search .icon-yangshi1,
  784. .icon-shaixuan {
  785. color: #fff;
  786. width: 62rpx;
  787. font-size: 40rpx;
  788. height: 86rpx;
  789. line-height: 86rpx;
  790. text-align: right;
  791. }
  792. .productList .nav {
  793. height: 86rpx;
  794. color: #454545;
  795. position: fixed;
  796. left: 0;
  797. width: 100%;
  798. font-size: 28rpx;
  799. background-color: #fff;
  800. top: 154rpx;
  801. z-index: 9;
  802. border-radius: 16rpx 16rpx 0rpx 0rpx;
  803. padding-left: 20rpx;
  804. }
  805. .productList .nav .item {
  806. width: 30%;
  807. text-align: center;
  808. .iconfont {
  809. //color: #fff;
  810. }
  811. }
  812. .item-c {
  813. width: 27% !important;
  814. }
  815. .item-icon {
  816. width: 8%;
  817. margin-left: 30rpx;
  818. }
  819. .item-shu {
  820. width: 1px;
  821. height: 12px;
  822. background: #666666;
  823. opacity: 0.2;
  824. }
  825. .productList .nav .item.font-color {
  826. font-weight: bold;
  827. }
  828. .productList .nav .item image {
  829. width: 15rpx;
  830. height: 19rpx;
  831. margin-left: 10rpx;
  832. }
  833. .productList .list.on {
  834. padding-top: 30rpx !important;
  835. background-color: #fff;
  836. border-top: 1px solid #F5F5F5;
  837. }
  838. .productList .list .item {
  839. width: 335rpx;
  840. background-color: #fff;
  841. border-radius: 14rpx;
  842. margin-bottom: 20rpx;
  843. }
  844. .productList .list .item.on {
  845. width: 100%;
  846. display: flex;
  847. padding: 0 24rpx 60rpx 24rpx;
  848. margin: 0;
  849. border-radius: 14rpx;
  850. }
  851. .productList .list .item .pictrue {
  852. position: relative;
  853. // width: 100%;
  854. }
  855. .productList .list .item .pictrue /deep/.easy-loadimage {
  856. width: 240rpx;
  857. height: 240rpx;
  858. border-radius: 14rpx;
  859. overflow: hidden;
  860. }
  861. .productList .list .item .pictrue image {
  862. width: 100%;
  863. height: 100%;
  864. border-radius: 20rpx 20rpx 0 0;
  865. overflow: hidden;
  866. }
  867. .productList .list .item .pictrue image.on {
  868. border-radius: 6rpx;
  869. }
  870. .productList .list .item .text {
  871. padding: 18rpx 20rpx;
  872. font-size: 30rpx;
  873. color: #222;
  874. }
  875. .productList .list .item .text.on {
  876. width: 456rpx;
  877. padding: 0 0 0 20rpx;
  878. position: relative;
  879. &::after {
  880. content: '';
  881. display: block;
  882. width: 94%;
  883. border-bottom: 1rpx solid #f6f6f6;
  884. position: absolute;
  885. right: 2rpx;
  886. bottom: -24rpx;
  887. }
  888. .name {
  889. height: 84rpx;
  890. line-height: 42rpx;
  891. }
  892. }
  893. .productList .list .item .text .money {
  894. font-size: 26rpx;
  895. font-weight: bold;
  896. margin-top: 8rpx;
  897. }
  898. .productList .list .item .text .money.on {
  899. margin-top: 50rpx;
  900. }
  901. .productList .list .item .text .money .num {
  902. font-size: 34rpx;
  903. }
  904. .productList .list .item .text .vip {
  905. font-size: 20rpx;
  906. color: #aaa;
  907. }
  908. .productList .list .item .text .vip .vip-money {
  909. font-size: 24rpx;
  910. color: #282828;
  911. font-weight: bold;
  912. }
  913. .productList .list .item .text .vip .vip-money image {
  914. width: 46rpx;
  915. height: 21rpx;
  916. margin-left: 4rpx;
  917. }
  918. .row-between-wrapper .input {
  919. height: 60rpx;
  920. margin: 10rpx 0 16rpx;
  921. }
  922. .box-line2 {
  923. overflow: hidden;
  924. }
  925. .mask {
  926. opacity: .5;
  927. position: fixed;
  928. inset: 0px;
  929. background-color: rgba(0, 0, 0, 0.4);
  930. transition: opacity 300ms ease 0ms, -webkit-transform 300ms ease 0ms, transform 300ms ease 0ms;
  931. transform-origin: 50% 50%;
  932. }
  933. .bg-color-good {
  934. color: $bg-color-primary;
  935. }
  936. </style>