index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  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: 'city', name: '同城'},
  224. {id: 2, range: 'all', 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. this.where.page = 1;
  336. this.loadend = false;
  337. this.loading = false;
  338. this.get_product_list(true);
  339. },
  340. goStore(id) {
  341. uni.navigateTo({
  342. url: `/pages/merchant/home/index?merId=${id}`
  343. })
  344. },
  345. confirm(data) {
  346. this.whereMer.typeIds = data.typeId;
  347. this.whereMer.categoryIds = data.categoryId;
  348. this.whereMer.keywords = this.where.keyword;
  349. this.loadend = false;
  350. this.$set(this.whereMer, 'page', 1)
  351. this.merchantList = [];
  352. this.rightDrawer = false
  353. this.getMerStreet();
  354. },
  355. changetab(n) {
  356. this.tabIndex = n;
  357. this.nows = 1;
  358. this.stock = 0;
  359. this.loadend = false;
  360. this.loading = false;
  361. if (n === 2) {
  362. this.merchantList = [];
  363. this.$set(this.whereMer, 'page', 1);
  364. this.getMerStreet();
  365. this.title = '';
  366. } else {
  367. this.whereMer.typeIds = '';
  368. this.whereMer.categoryIds = '';
  369. this.productList = [];
  370. this.$set(this.where, 'page', 1);
  371. this.get_product_list();
  372. }
  373. },
  374. open(n) {
  375. if (this.tabIndex === 2) {
  376. this.rightDrawer = true;
  377. this.drawers = n;
  378. }
  379. },
  380. closeDrawer(e) {
  381. this.rightDrawer = false
  382. if (!e) {
  383. this.rightDrawer = false
  384. }
  385. },
  386. goback() {
  387. // #ifdef H5
  388. return history.back();
  389. // #endif
  390. // #ifndef H5
  391. return uni.navigateBack({
  392. delta: 1,
  393. })
  394. // #endif
  395. },
  396. getMerStreet: function(isPage) {
  397. this.skeletonShow = true
  398. let that = this;
  399. that.setWhere();
  400. if (that.loadend) return;
  401. if (that.loading) return;
  402. that.loading = true;
  403. if (isPage === true) that.$set(that, 'merchantList', []);
  404. that.loadTitle = '';
  405. that.whereMer.keywords = encodeURIComponent(that.keyword);
  406. that.cateId ? that.whereMer.productType = that.cateId : '';
  407. getMerSearchApi(that.whereMer).then(res => {
  408. let list = res.data.list;
  409. let merchantList = that.$util.SplitArray(list, that.merchantList);
  410. let loadend = list.length < that.whereMer.limit;
  411. that.loadend = loadend;
  412. that.loadTitle = loadend ? '没有了' : '加载更多';
  413. that.$set(that, 'merchantList', merchantList);
  414. that.$set(that.whereMer, 'page', that.whereMer.page + 1);
  415. that.loading = false;
  416. this.skeletonShow = false;
  417. this.isShow = true
  418. }).catch(err => {
  419. that.loading = false;
  420. that.goodScroll = false;
  421. that.loadTitle = '加载更多';
  422. });
  423. },
  424. // 去详情页
  425. godDetail(item) {
  426. goProductDetail(item.id, 0, '');
  427. },
  428. Changswitch: function() {
  429. let that = this;
  430. that.is_switch = !that.is_switch
  431. },
  432. searchSubmit: function(e) {
  433. let that = this;
  434. that.loadend = false;
  435. that.$set(that, 'keyword', e.detail.value || '');
  436. if (that.tabIndex === 1) {
  437. that.$set(that.where, 'page', 1)
  438. this.get_product_list(true);
  439. } else {
  440. that.$set(that, 'merchantList', []);
  441. this.$set(this.whereMer, 'page', 1)
  442. this.getMerStreet();
  443. }
  444. },
  445. //点击事件处理
  446. set_where: function(e, n) {
  447. switch (e) {
  448. case 1:
  449. this.price = 0;
  450. this.stock = 0;
  451. break;
  452. case 2:
  453. if (this.price == 0) this.price = 1;
  454. else if (this.price == 1) this.price = 2;
  455. else if (this.price == 2) this.price = 0;
  456. this.stock = 0;
  457. break;
  458. case 3:
  459. if (this.stock == 0) this.stock = 1;
  460. else if (this.stock == 1) this.stock = 2;
  461. else if (this.stock == 2) this.stock = 0;
  462. this.price = 0
  463. break;
  464. case 4:
  465. this.price = 0;
  466. this.stock = 0;
  467. break;
  468. }
  469. if (n === 1) {
  470. this.loadend = false;
  471. this.$set(this.where, 'page', 1);
  472. this.get_product_list(true);
  473. } else {
  474. this.nows = 1;
  475. }
  476. },
  477. //设置where条件
  478. setWhere: function() {
  479. if (this.price == 0) this.where.priceOrder = '';
  480. else if (this.price == 1) this.where.priceOrder = 'asc';
  481. else if (this.price == 2) this.where.priceOrder = 'desc';
  482. if (this.stock == 0) this.where.salesOrder = '';
  483. else if (this.stock == 1) this.where.salesOrder = 'asc';
  484. else if (this.stock == 2) this.where.salesOrder = 'desc';
  485. //this.where.news = this.nows ? 1 : 0;
  486. },
  487. //查找产品
  488. get_product_list: function(isPage) {
  489. let that = this;
  490. that.setWhere();
  491. if (that.loadend) return;
  492. if (that.loading) return;
  493. if (isPage === true) that.$set(that, 'productList', []);
  494. that.loading = true;
  495. that.loadTitle = '';
  496. if (this.merId > 0) that.where.merId = that.merId
  497. that.where.keyword = encodeURIComponent(that.keyword);
  498. that.cateId ? that.where.productType = that.cateId : '';
  499. if (that.cid === 0) {
  500. that.where.cid = '';
  501. that.where.cids = '';
  502. } else {
  503. if (this.merId > 0) {
  504. that.where.cids = that.cid
  505. that.where.cid = '';
  506. } else {
  507. that.where.cid = that.cid;
  508. that.where.cids = ''
  509. }
  510. }
  511. if (this.fairCateId) {
  512. that.where.range = this.rangeStr
  513. if (that.where.range == 'city') {
  514. that.where.city = uni.getStorageSync('cityName')
  515. }
  516. that.where.categoryId = this.fairCateId
  517. console.log(this.where)
  518. getSecondHandListApi(that.where).then(res => {
  519. let list = res.data.list;
  520. let productList = that.$util.SplitArray(list, that.productList);
  521. let loadend = list.length < that.where.limit;
  522. that.loadend = loadend;
  523. that.loading = false;
  524. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  525. that.$set(that, 'productList', productList);
  526. that.$set(that.where, 'page', that.where.page + 1);
  527. this.isShow = true
  528. }).catch(err => {
  529. that.loading = false;
  530. that.loadTitle = '加载更多'
  531. })
  532. } else {
  533. this.merId === 0 ? productList(that.where).then(res => {
  534. let list = res.data.list;
  535. let productList = that.$util.SplitArray(list, that.productList);
  536. let loadend = list.length < that.where.limit;
  537. that.loadend = loadend;
  538. that.loading = false;
  539. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  540. that.$set(that, 'productList', productList);
  541. that.$set(that.where, 'page', that.where.page + 1);
  542. this.isShow = true
  543. }).catch(err => {
  544. that.loading = false;
  545. that.loadTitle = '加载更多'
  546. }) : getMerProListApi(that.where).then(res => {
  547. let list = res.data.list;
  548. let productList = that.$util.SplitArray(list, that.productList);
  549. let loadend = list.length < that.where.limit;
  550. that.loadend = loadend;
  551. that.loading = false;
  552. that.loadTitle = loadend ? '已全部加载' : '加载更多';
  553. that.$set(that, 'productList', productList);
  554. that.$set(that.where, 'page', that.where.page + 1);
  555. this.isShow = true
  556. }).catch(err => {
  557. that.loading = false;
  558. that.loadTitle = '加载更多'
  559. })
  560. }
  561. },
  562. },
  563. onReachBottom() {
  564. console.log(1111111111111111)
  565. if (this.tabIndex === 2) {
  566. this.getMerStreet();
  567. }
  568. if (this.productList.length > 0) {
  569. this.get_product_list();
  570. }
  571. if ((this.productList.length == 0 && this.isShow && this.tabIndex === 1 && !this.loading) || (this.merchantList
  572. .length == 0 && this.isShow && this.tabIndex === 2 && !this.loading)) {
  573. this.$refs.recommendIndex.get_host_product();
  574. }
  575. }
  576. }
  577. </script>
  578. <style>
  579. body {
  580. height: auto !important;
  581. }
  582. </style>
  583. <style scoped lang="scss">
  584. .mt80 {
  585. margin-top: 80rpx;
  586. }
  587. .searchIpt {
  588. /* #ifdef H5 */
  589. width: 91% !important;
  590. /* #endif */
  591. /* #ifndef H5 */
  592. width: 100% !important;
  593. /* #endif */
  594. }
  595. .store-item .merTab {
  596. height: auto !important;
  597. .tab-item {
  598. margin-top: 8rpx !important;
  599. }
  600. }
  601. .text-ccc {
  602. text-align: center;
  603. display: block;
  604. }
  605. .company {
  606. display: flex;
  607. align-items: center;
  608. color: #737373 !important;
  609. font-size: 26rpx;
  610. .name {
  611. display: inline-block;
  612. // width: 120rpx;
  613. height: auto !important;
  614. overflow: hidden;
  615. white-space: nowrap;
  616. text-overflow: ellipsis;
  617. }
  618. .flex {
  619. display: flex;
  620. align-items: center;
  621. margin-left: 10rpx;
  622. color: #282828 !important;
  623. width: 100rpx;
  624. .iconfont {
  625. font-size: 16rpx;
  626. margin-top: 4rpx;
  627. }
  628. }
  629. }
  630. .icon-xiangzuo {
  631. color: #fff;
  632. }
  633. .goods {
  634. display: flex;
  635. flex-wrap: wrap;
  636. justify-content: space-between;
  637. padding-left: 24rpx;
  638. background-color: #F5F5F5;
  639. width: 100%;
  640. }
  641. .proList {
  642. margin-top: 256rpx;
  643. }
  644. .merList {
  645. position: relative;
  646. top: 154rpx;
  647. z-index: 66;
  648. }
  649. .merBox {
  650. /deep/.tui-drawer-container {
  651. width: 635rpx;
  652. }
  653. }
  654. .mer {
  655. &-nav {
  656. top: 80rpx !important;
  657. border-radius: inherit !important;
  658. }
  659. &-list {
  660. margin-top: 248rpx !important;
  661. }
  662. &-listBox {
  663. position: relative;
  664. top: -68rpx;
  665. }
  666. &-mt194 {
  667. margin-top: 260rpx !important;
  668. }
  669. &-mt100 {
  670. top: -200rpx !important;
  671. }
  672. }
  673. .no-shop {
  674. margin-top: 6rpx;
  675. background-color: #fff;
  676. padding-bottom: calc(100% - 109rpx);
  677. .pictrue {
  678. display: flex;
  679. flex-direction: column;
  680. align-items: center;
  681. //color: $uni-nothing-text;
  682. image {
  683. width: 414rpx;
  684. height: 380rpx;
  685. }
  686. }
  687. }
  688. .with50 {
  689. width: 50% !important;
  690. }
  691. .nav-wrapper {
  692. z-index: 9;
  693. position: fixed;
  694. left: 0;
  695. top: 86rpx;
  696. width: 100%;
  697. @include main_bg_color(theme);
  698. .tab-bar {
  699. display: flex;
  700. align-items: center;
  701. height: 131rpx;
  702. .tab-item {
  703. position: relative;
  704. flex: 1;
  705. display: flex;
  706. justify-content: center;
  707. align-items: center;
  708. padding-bottom: 40rpx;
  709. color: #fff;
  710. font-size: 28rpx;
  711. font-weight: bold;
  712. margin-top: -36rpx;
  713. &::after {
  714. content: ' ';
  715. position: absolute;
  716. left: 50%;
  717. bottom: 34rpx;
  718. width: 60rpx;
  719. height: 3rpx;
  720. background: transparent;
  721. transform: translateX(-50%);
  722. }
  723. &.on {
  724. &::after {
  725. background: #fff;
  726. }
  727. }
  728. }
  729. }
  730. }
  731. .bg_color {
  732. @include main_bg_color(theme);
  733. }
  734. .font_color {
  735. @include main_color(theme);
  736. }
  737. .x-money {
  738. font-size: 38rpx;
  739. font-weight: 900;
  740. @include price_color(theme);
  741. }
  742. .iconfont {
  743. //color: #fff;
  744. }
  745. .listBox {
  746. margin-top: 240rpx !important;
  747. background-color: #FFFFFF;
  748. }
  749. .fixed-top {
  750. position: fixed;
  751. top: 0;
  752. left: 0;
  753. z-index: 9;
  754. }
  755. .productList .search {
  756. width: 100%;
  757. height: 86rpx;
  758. padding: 0 30rpx;
  759. box-sizing: border-box;
  760. position: fixed;
  761. top: 0 !important;
  762. left: 0;
  763. z-index: 666;
  764. color: #fff;
  765. }
  766. .productList .search .input {
  767. width: 570rpx;
  768. height: 60rpx;
  769. background-color: #fff;
  770. border-radius: 50rpx;
  771. padding: 0 20rpx;
  772. box-sizing: border-box;
  773. color: #333;
  774. }
  775. .productList .search .input input {
  776. width: 88%;
  777. height: 100%;
  778. font-size: 26rpx;
  779. }
  780. .productList .search .input .placeholder {
  781. color: #CCCCCC;
  782. }
  783. .productList .search .input .iconfont {
  784. font-size: 26rpx;
  785. color: #999999;
  786. }
  787. .productList .search .icon-yangshi1,
  788. .icon-shaixuan {
  789. color: #fff;
  790. width: 62rpx;
  791. font-size: 40rpx;
  792. height: 86rpx;
  793. line-height: 86rpx;
  794. text-align: right;
  795. }
  796. .productList .nav {
  797. height: 86rpx;
  798. color: #454545;
  799. position: fixed;
  800. left: 0;
  801. width: 100%;
  802. font-size: 28rpx;
  803. background-color: #fff;
  804. top: 154rpx;
  805. z-index: 9;
  806. border-radius: 16rpx 16rpx 0rpx 0rpx;
  807. padding-left: 20rpx;
  808. }
  809. .productList .nav .item {
  810. width: 30%;
  811. text-align: center;
  812. .iconfont {
  813. //color: #fff;
  814. }
  815. }
  816. .item-c {
  817. width: 27% !important;
  818. }
  819. .item-icon {
  820. width: 8%;
  821. margin-left: 30rpx;
  822. }
  823. .item-shu {
  824. width: 1px;
  825. height: 12px;
  826. background: #666666;
  827. opacity: 0.2;
  828. }
  829. .productList .nav .item.font-color {
  830. font-weight: bold;
  831. }
  832. .productList .nav .item image {
  833. width: 15rpx;
  834. height: 19rpx;
  835. margin-left: 10rpx;
  836. }
  837. .productList .list.on {
  838. padding-top: 30rpx !important;
  839. background-color: #fff;
  840. border-top: 1px solid #F5F5F5;
  841. }
  842. .productList .list .item {
  843. width: 335rpx;
  844. background-color: #fff;
  845. border-radius: 14rpx;
  846. margin-bottom: 20rpx;
  847. }
  848. .productList .list .item.on {
  849. width: 100%;
  850. display: flex;
  851. padding: 0 24rpx 60rpx 24rpx;
  852. margin: 0;
  853. border-radius: 14rpx;
  854. }
  855. .productList .list .item .pictrue {
  856. position: relative;
  857. // width: 100%;
  858. }
  859. .productList .list .item .pictrue /deep/.easy-loadimage {
  860. width: 240rpx;
  861. height: 240rpx;
  862. border-radius: 14rpx;
  863. overflow: hidden;
  864. }
  865. .productList .list .item .pictrue image {
  866. width: 100%;
  867. height: 100%;
  868. border-radius: 20rpx 20rpx 0 0;
  869. overflow: hidden;
  870. }
  871. .productList .list .item .pictrue image.on {
  872. border-radius: 6rpx;
  873. }
  874. .productList .list .item .text {
  875. padding: 18rpx 20rpx;
  876. font-size: 30rpx;
  877. color: #222;
  878. }
  879. .productList .list .item .text.on {
  880. width: 456rpx;
  881. padding: 0 0 0 20rpx;
  882. position: relative;
  883. &::after {
  884. content: '';
  885. display: block;
  886. width: 94%;
  887. border-bottom: 1rpx solid #f6f6f6;
  888. position: absolute;
  889. right: 2rpx;
  890. bottom: -24rpx;
  891. }
  892. .name {
  893. height: 84rpx;
  894. line-height: 42rpx;
  895. }
  896. }
  897. .productList .list .item .text .money {
  898. font-size: 26rpx;
  899. font-weight: bold;
  900. margin-top: 8rpx;
  901. }
  902. .productList .list .item .text .money.on {
  903. margin-top: 50rpx;
  904. }
  905. .productList .list .item .text .money .num {
  906. font-size: 34rpx;
  907. }
  908. .productList .list .item .text .vip {
  909. font-size: 20rpx;
  910. color: #aaa;
  911. }
  912. .productList .list .item .text .vip .vip-money {
  913. font-size: 24rpx;
  914. color: #282828;
  915. font-weight: bold;
  916. }
  917. .productList .list .item .text .vip .vip-money image {
  918. width: 46rpx;
  919. height: 21rpx;
  920. margin-left: 4rpx;
  921. }
  922. .row-between-wrapper .input {
  923. height: 60rpx;
  924. margin: 10rpx 0 16rpx;
  925. }
  926. .box-line2 {
  927. overflow: hidden;
  928. }
  929. .mask {
  930. opacity: .5;
  931. position: fixed;
  932. inset: 0px;
  933. background-color: rgba(0, 0, 0, 0.4);
  934. transition: opacity 300ms ease 0ms, -webkit-transform 300ms ease 0ms, transform 300ms ease 0ms;
  935. transform-origin: 50% 50%;
  936. }
  937. .bg-color-good {
  938. color: $bg-color-primary;
  939. }
  940. </style>