12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328 |
- <template>
- <view class="container all-type-list-wrapper">
- <!-- 自定义顶部 -->
- <custom-floor :systeminfo="systeminfo" :navbar-data="nvabarData" :headerBtnPosi="headerBtnPosi"></custom-floor>
- <view class="tui-header-screen" :style="{ top: CustomBar + 'px' }">
- <view class="tui-screen-top">
- <view
- class="tui-top-item"
- :class="[tabIndex == 0 ? 'tui-active' : '']"
- @tap="handleScreen"
- data-index="0"
- >综合</view
- >
- <view
- class="tui-top-item tui-icon-ml"
- :class="[tabIndex == 1 ? 'tui-active' : '']"
- data-index="1"
- @tap="handleScreen"
- >
- <view>销量</view> <text class="iconfont icon-shangxiajiantou" v-if="isSearchSalesFirst"></text>
- <template v-else>
- <tui-icon
- :name="isSearchSales ? 'turningdown' : 'turningup'"
- :size="18"
- :color="tabIndex == 1 ? '#F3B574' : '#999'"
- tui-icon-class="tui-ml"
- ></tui-icon>
- </template>
- </view>
- <view
- class="tui-top-item tui-icon-ml"
- :class="[tabIndex == 2 ? 'tui-active' : '']"
- data-index="2"
- @tap="handleScreen"
- >
- <view>人气</view> <text class="iconfont icon-shangxiajiantou" v-if="isSearchMoodFirst"></text>
- <template v-else>
- <tui-icon
- :name="isSearchMood ? 'turningdown' : 'turningup'"
- :size="18"
- :color="tabIndex == 2 ? '#F3B574' : '#999'"
- tui-icon-class="tui-ml"
- ></tui-icon>
- </template>
- </view>
- <view
- class="tui-top-item tui-icon-ml"
- :class="[tabIndex == 3 ? 'tui-active' : '']"
- data-index="3"
- @tap="handleScreen"
- >
- <view>价格</view> <text class="iconfont icon-shangxiajiantou" v-if="isSearchPriceFirst"></text>
- <template v-else>
- <tui-icon
- :name="isSearchPrice ? 'turningdown' : 'turningup'"
- :size="18"
- :color="tabIndex == 3 ? '#F3B574' : '#999'"
- tui-icon-class="tui-ml"
- ></tui-icon>
- </template>
- </view>
- <view class="tui-top-item" @tap="handleScreen" data-index="4">
- <view>筛选</view> <text class="iconfont icon-shaixuan"></text>
- </view>
- </view>
- </view>
- <!-- 商品列表 -->
- <list-skeleton v-if="showSkeleton" :listType="0"></list-skeleton>
- <template v-else>
- <view class="empty-container" v-if="showEmpty">
- <image
- class="empty-container-image"
- src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"
- ></image>
- <text class="error-text">{{ emptyText }}</text>
- </view>
- <template v-else>
- <view
- class="container-list"
- :style="{ height: scrollHeight + 'px', paddingTop: CustomBar + 44 + 'px' }"
- >
- <view
- v-for="(pros, index) in listData"
- :key="index"
- :id="pros.productId"
- class="all-type-list-content commodity-list"
- @click.stop="navToDetailPage(pros.productId)"
- >
- <view class="list-details-image">
- <image mode="widthFix" :src="pros.image" class="list-img" alt="list-img"></image>
- <view class="list-details-type" v-if="pros.productType == 2">医疗器械</view>
- </view>
- <view class="list-details-info">
- <text class="list-details-title">
- <text class="mclap-tag" v-if="pros.beautyActFlag == 1">美博会</text>
- <text class="mclap" :class="pros.beautyActFlag == 1 ? 'indent' : ''">{{
- pros.name
- }}</text>
- </text>
- <text class="list-details-specs">规格:{{ pros.unit }}</text>
- <view class="list-details-specs" v-if="pros.code != '' && pros.code != null"
- >商品编码:{{ pros.code }}</view
- >
- <view class="list-details-price">
- <template v-if="userIdentity == 3">
- <view class="floor-item-act">
- <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
- <template v-if="pros.actStatus == 1">
- <view class="floor-tags" v-if="PromotionsFormat(pros.promotions)">
- {{ pros.promotions.name }}
- <text v-if="hasLogin && userIdentity == 3 && pros.priceFlag != 1"
- >:¥{{ pros.price | NumFormat }}</text
- >
- </view>
- <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
- </template>
- <template v-if="pros.svipProductFlag == 1">
- <view
- class="svip-tags"
- v-if="hasLogin && userIdentity == 3 && pros.priceFlag != 1"
- >
- <view class="tags">SVIP</view>
- <view class="price">{{ pros.svipPriceTag }}</view>
- </view>
- <view class="svip-tags" v-else> <view class="tags none">SVIP</view> </view>
- </template>
- </view>
- </template>
- <template v-else-if="userIdentity == 1">
- <view class="floor-item-act">
- <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
- <template v-if="pros.actStatus == 1">
- <view
- class="floor-tags"
- v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
- >
- {{ pros.promotions.name }} <text>:¥{{ pros.price | NumFormat }}</text>
- </view>
- <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
- </template>
- <template v-if="pros.svipProductFlag == 1">
- <view class="svip-tags"><view class="tags none">SVIP</view> </view>
- </template>
- </view>
- </template>
- <template v-else>
- <view class="floor-item-act">
- <view class="coupon-tags" v-if="pros.couponsLogo">优惠券</view>
- <template v-if="pros.actStatus == 1">
- <view
- class="floor-tags"
- v-if="pros.actStatus == 1 && PromotionsFormat(pros.promotions)"
- >
- {{ pros.promotions.name }}
- <text v-if="hasLogin && ((userIdentity === 4 && pros.priceFlag === 0) || (userIdentity === 2 && pros.priceFlag !== 1))"
- >:¥{{ pros.price | NumFormat }}</text
- >
- </view>
- <view class="floor-tags" v-else>{{ pros.promotions.name }}</view>
- </template>
- <template v-if="pros.svipProductFlag == 1">
- <view class="svip-tags">
- <view class="tags" :class="{ none: !isShowVipFlag(pros) }">SVIP</view>
- <view class="price" v-if="isShowVipFlag(pros)">{{
- pros.svipPriceTag
- }}</view>
- </view>
- </template>
- </view>
- </template>
- <view v-if="hasLogin" class="list-price">
- <template v-if="userIdentity == 1">
- <text v-if="priceLoading" class="price-larger small">正在获取价格...</text>
- <template v-else>
- <text
- class="price-larger"
- :class="
- PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? 'none'
- : ''
- "
- >
- ¥{{
- (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? pros.originalPrice
- : pros.price) | NumFormat
- }}
- </text>
- </template>
- </template>
- <template v-if="userIdentity == 4 && vipFlag != 1">
- <view class="price-larger" v-if="pros.priceFlag == 1">
- <text class="txt">¥未公开价格</text>
- </view>
- <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
- <template v-else>
- <view class="price-larger" v-if="pros.priceFlag == 2">
- <text class="txt">¥价格仅会员可见</text>
- </view>
- <view class="price-larger" v-else-if="pros.priceFlag == 3">
- <text class="txt">¥仅医美机构可见</text>
- </view>
- <text
- v-else
- class="price-larger"
- :class="
- PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? 'none'
- : ''
- "
- >
- ¥{{
- (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? pros.originalPrice
- : pros.price) | NumFormat
- }}
- </text>
- </template>
- </template>
- <template v-if="userIdentity == 3">
- <template v-if="pros.supplierId === shopId">
- <view class="price-larger" v-if="pros.priceFlag == 1">
- <text class="txt">¥未公开价格</text>
- </view>
- <text v-else-if="priceLoading" class="price-larger small"
- >正在获取价格...</text
- >
- <text
- v-else
- class="price-larger"
- :class="
- PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? 'none'
- : ''
- "
- >
- ¥{{
- (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? pros.originalPrice
- : pros.price) | NumFormat
- }}
- </text>
- </template>
- <template v-else>
- <view class="list-login-now">
- <text class="p-no">¥</text>
- <uni-grader :grade="Number(pros.priceGrade)"></uni-grader>
- </view>
- </template>
- </template>
- <template v-if="userIdentity == 2 || (userIdentity == 4 && vipFlag == 1)">
- <view class="price-larger" v-if="pros.priceFlag == 1">
- <text class="txt">¥未公开价格</text>
- </view>
- <text v-else-if="priceLoading" class="price-larger small">正在获取价格...</text>
- <template v-else>
- <view class="price-larger" v-if="pros.priceFlag == 3 && (firstClubType!=1)">
- <text class="txt">¥仅医美机构可见</text>
- </view>
- <text
- v-else
- class="price-larger"
- :class="
- PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? 'none'
- : ''
- "
- >
- ¥{{
- (PromotionsFormat(pros.promotions) || pros.svipProductFlag == 1
- ? pros.originalPrice
- : pros.price) | NumFormat
- }}
- </text>
- </template>
- </template>
- </view>
- <view v-else class="list-login-now">
- <text class="p-no">¥</text>
- <uni-grader :grade="Number(pros.priceGrade)"></uni-grader>
- </view>
- </view>
- </view>
- </view>
- <!--加载loadding-->
- <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
- <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text="nomoreText"></tui-nomore>
- <!--加载loadding-->
- </view>
- </template>
- </template>
- <!--右抽屉-->
- <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
- <view
- class="drawer-container clearfix"
- scroll-y
- :style="{ paddingTop: CustomBar + 'px', paddingBottom: isIphoneX ? '180rpx' : '146rpx' }"
- >
- <scroll-view class="tui-drawer-scroll" scroll-y :style="{ height: drawerH + 'px' }">
- <view class="drawer-title">
- <view class="drawer-title-h1">品牌</view>
- <view class="drawer-title-p"
- >已选中<text class="text">{{ checkedBrandLength }}</text
- >个品牌</view
- >
- </view>
- <view class="drawer-main">
- <view class="drawer-main-brand clearfix">
- <view
- class="drawer-brand-list"
- :class="isAllcheckedBrand ? 'checked' : ''"
- @click="choiceBrandAll"
- >全部</view
- >
- <view
- class="drawer-brand-list"
- :class="brand.isChecked ? 'checked' : ''"
- v-for="(brand, index) in brandLists"
- :key="index"
- @click="choiceBrand(brand, index)"
- >
- {{ brand.name }}
- </view>
- <view class="drawer-brand-more" v-if="!isShowAllBrands" @click="showAllBrands"
- >查看全部<text class="iconfont icon-xiangxiajiantou"></text
- ></view>
- </view>
- <view class="drawer-main-radio">
- <view class="drawer-radio-name">新品</view>
- <view class="drawer-radio-input" @click="choiceNewType">
- <text
- class="iconfont"
- :class="isChoiceNewType ? 'icon-yixuanze' : 'icon-weixuanze'"
- ></text>
- </view>
- </view>
- <view class="drawer-main-radio">
- <view class="drawer-radio-name">促销商品</view>
- <view class="drawer-radio-input" @click="choiceActiType">
- <text
- class="iconfont"
- :class="isChoiceActiType ? 'icon-yixuanze' : 'icon-weixuanze'"
- ></text>
- </view>
- </view>
- </view>
- </scroll-view>
- <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
- <view class="drawer-btn clear" @click="closeDrawer">取消</view>
- <view class="drawer-btn comfrim" @click="handSearchList">确定</view>
- </view>
- </view>
- </tui-drawer>
- <!-- 透明模态层 -->
- <modal-layer v-if="isModallayer"></modal-layer>
- </view>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import listSkeleton from '@/components/cm-module/listTemplate/listSkeleton'
- import customFloor from '@/components/cm-custom/custom-floor' //自定义导航
- import uniGrader from '@/components/uni-grade/uni-grade.vue'
- import modalLayer from '@/components/modal-layer'
- import authorize from '@/common/config/authorize.js'
- import wxLogin from '@/common/config/wxLogin.js'
- export default {
- components: {
- customFloor,
- listSkeleton,
- uniGrader,
- modalLayer
- },
- data() {
- return {
- shopId: 0,
- tabIndex: 0,
- isModallayer: false,
- isShowAllBrands: false,
- isSearchSalesFirst: true,
- isSearchMoodFirst: true,
- isSearchPriceFirst: true,
- isSearchSales: true,
- isSearchMood: true,
- isSearchPrice: true,
- isChoiceNewType: false,
- isChoiceActiType: false,
- isAllcheckedBrand: false,
- headerBtnPosi: this.setHeaderBtnPosi(), //获取设备顶部胶囊高度
- systeminfo: this.setSysteminfo(), //获取设备信息
- CustomBar: this.CustomBar, // 顶部导航栏高度
- isIphoneX: this.$store.state.isIphoneX,
- emptyText: '该分类暂时还没有商品哟,去逛逛别的吧~',
- isRequest: false,
- showSkeleton: true,
- showEmpty: false,
- userId: 0,
- vipFlag: 0,
- userIdentity: 0,
- listData: [],
- brandLists: [],
- checkedBrandList: [],
- checkedBrandLength: 0,
- windowHeight: '',
- scrollHeight: '',
- pathQueryId:0,
- firstClubType:0,
- listQuery: {
- id: 0,
- identity: 0,
- pageNum: 1,
- pageSize: 10,
- sortField: '',
- sortType: 1,
- brandIds: '', // 品牌Id
- newFlag: 0, // 查询新品标记,默认0,新品1
- promotionFlag: 0, // 查询促销标记,默认0,促销1
- idType: 0 //一级
- },
- brandParam: {
- keyword: '',
- id: '',
- idType: '',
- identity: 0
- },
- priceLoading: true,
- loadding: false,
- pullUpOn: true,
- pullFlag: true,
- totalPage: 0,
- nomoreText: '上拉显示更多',
- rightDrawer: false,
- classifyType: 0,
- classData: {},
- searchCheckedId: null,
- height: 0,
- drawerH: 0 // 抽屉内部scrollview高度
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo', 'identity', 'clubType'])
- },
- onLoad(option) {
- console.log(option)
- if (option.type == 'share') {
- wxLogin.wxLoginAuthorize()
- }
- this.SetScrollHeight()
- this.initGetStotage(option)
- },
- filters: {
- NumFormat: function(text) {
- //处理金额
- return Number(text).toFixed(2)
- }
- },
- methods: {
- async initGetStotage(option) {
- const userInfo = await this.$api.getStorage()
- this.firstClubType = this.clubType
- this.listQuery.id = this.pathQueryId = this.brandParam.id = option.id
- this.listQuery.identity = this.identity
- this.listQuery.idType = this.classifyType = this.brandParam.idType = Number(option.classType)
- uni.setStorageSync('pageLabel',option.title)
- uni.setNavigationBarTitle({ title: option.title })
- this.userId = userInfo.userId ? userInfo.userId : 0
- this.shopId = userInfo.shopId ? userInfo.shopId : 0
- this.userIdentity = userInfo.userIdentity ? userInfo.userIdentity : 0
- this.vipFlag = userInfo.vipFlag ? userInfo.vipFlag : 0
- this.isRequest = true
- this.GetProductListInfo()
- this.GetProductOneClassly()
- this.getCommoditySearchQUeryBrand()
- console.log(this.classifyID)
- },
- GetProductOneClassly() {
- //根据分类ID 查询二三级分类
- this.CommonService.GetProductOneClassly({
- typeId: this.listQuery.id,
- idType: this.classifyType,
- source: 'crm'
- })
- .then(response => {
- this.classData = response.data
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- getCommoditySearchQUeryBrand() {
- // 查询筛选项品牌
- this.ProductService.getCommoditySearchQUeryBrand(this.brandParam)
- .then(response => {
- const data = response.data
- this.defaultBrandLists = data.map((el, index) => {
- el.isChecked = false
- return el
- })
- if(this.defaultBrandLists.length>11){
- this.isShowAllBrands = false
- }else{
- this.isShowAllBrands = true
- }
- this.brandLists = this.defaultBrandLists.slice(0, 11)
- console.log('品牌=============>', this.brandLists)
- })
- .catch(error => {
- console.log('查询品牌列表异常')
- })
- },
- GetProductListInfo() {
- //查询分类商品列表
- this.listQuery.pageNum = 1
- this.ProductService.GetSearchProductTypeData(this.listQuery)
- .then(response => {
- const resData = JSON.parse(response.data)
- const resList = resData.items
- this.showSkeleton = false
- if (resList && resList.length > 0) {
- this.showEmpty = false
- this.totalPage = resData.total
- this.listData = [...resList]
- this.GetProductPrice()
- // 防上拉暴滑
- this.pullFlag = false
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- // 底部提示文案
- if (this.totalPage > this.listData.length) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- if (this.listData.length > 4) {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- } else {
- this.pullUpOn = true
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- }
- console.log(this.listData)
- } else {
- this.showEmpty = true
- }
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- GetOnReachBottomData() {
- //上拉加载
- this.listQuery.pageNum += 1
- this.ProductService.GetSearchProductTypeData(this.listQuery)
- .then(response => {
- const resData = JSON.parse(response.data)
- const resList = resData.items
- this.totalPage = resData.total
- this.listData = [...this.listData, ...resList]
- this.GetProductPrice()
- // 防上拉暴滑
- this.pullFlag = false
- setTimeout(() => {
- this.pullFlag = true
- }, 500)
- // 底部提示文案
- if (this.totalPage > this.listData.length) {
- this.pullUpOn = false
- this.nomoreText = '上拉显示更多'
- } else {
- this.pullUpOn = false
- this.loadding = false
- this.nomoreText = '已至底部'
- }
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- GetProductPrice() {
- //获取价格
- let productIdArr = []
- this.listData.map(item => {
- // 0公开价格 1不公开价格 2仅对资质机构公开
- productIdArr.push(item.productId)
- })
- this.priceLoading = true
- this.productIds = productIdArr.join(',')
- this.ProductService.querySearchProductPrice({
- userId: this.userId,
- productIds: this.productIds,
- source: 2
- })
- .then(response => {
- if (response.data) {
- this.listData = this.ReturnNewProducts(this.listData, response.data)
- }
- this.priceLoading = false
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- })
- },
- ReturnNewProducts(Array, list) {
- //处理对应商品ID的商品价格
- let NewArray = []
- Array.map(item => {
- for (let i = 0; i < list.length; i++) {
- if (item.productId == list[i].productId) {
- NewArray.push(Object.assign(item, list[i]))
- }
- }
- })
- return NewArray
- },
- handleScreen(e) {
- let index = e.currentTarget.dataset.index
- console.log(index)
- if (index == 0) {
- this.tabIndex = 0
- this.isSearchSalesFirst = true
- this.isSearchMoodFirst = true
- this.isSearchPriceFirst = true
- this.listQuery.sortType = 1
- this.listQuery.sortField = ''
- this.GetProductListInfo()
- } else if (index == 1) {
- this.tabIndex = 1
- this.isSearchSalesFirst = false
- this.isSearchMoodFirst = true
- this.isSearchPriceFirst = true
- this.isSearchSales = !this.isSearchSales
- if (this.isSearchSales) {
- this.listQuery.sortType = 1
- } else {
- this.listQuery.sortType = 0
- }
- this.listQuery.sortField = 'sales'
- this.GetProductListInfo()
- } else if (index == 2) {
- this.tabIndex = 2
- this.isSearchSalesFirst = true
- this.isSearchPriceFirst = true
- this.isSearchMoodFirst = false
- this.isSearchMood = !this.isSearchMood
- if (this.isSearchMood) {
- this.listQuery.sortType = 1
- } else {
- this.listQuery.sortType = 0
- }
- this.listQuery.sortField = 'favorite'
- this.GetProductListInfo()
- } else if (index == 3) {
- this.tabIndex = 3
- this.isSearchSalesFirst = true
- this.isSearchMoodFirst = true
- this.isSearchPriceFirst = false
- this.isSearchPrice = !this.isSearchPrice
- if (this.isSearchPrice) {
- this.listQuery.sortType = 1
- } else {
- this.listQuery.sortType = 0
- }
- this.listQuery.sortField = 'price'
- this.GetProductListInfo()
- } else if (index == 4) {
- console.log('type', this.listQuery.id)
- this.searchClickFn()
- }
- },
- handSearchList() {
- //确定筛选
- if (this.searchCheckedId == null) {
- this.listQuery.id = this.pathQueryId
- } else {
- this.listQuery.id = this.searchCheckedId
- }
- this.rightDrawer = false
- this.GetProductListInfo()
- },
- navToDetailPage(id) {
- this.isModallayer = true
- this.$api.navigateTo(`/pages/goods/product?id=${id}`)
- this.isModallayer = false
- },
- PromotionsFormat(promo) {
- //促销活动类型数据处理
- if (promo != null) {
- if (promo.type == 1 && promo.mode == 1) {
- return true
- } else {
- return false
- }
- }
- return false
- },
- isShowVipFlag(pros) {
- /**
- *显示SVIP和超级会员价格:
- * 个人机构(不是超级会员,但价格所有机构可见),
- * 资质机构(不是超级会员,但价格所有机构可见或仅会员可见),
- * 超级会员(价格所有机构可见或仅会员可见),超级会员(是医美机构,价格仅医美可见)
- *商品价格是否可见:priceFlag 0:所有机构可见 1:未公开价格 2:仅会员可见 3:仅医美机构可见
- * 普通机构
- * 超级会员 && priceFlag === 0
- * 资质机构
- * priceFlag !== 1 ||
- * 超级会员
- * 商品priceFlag === 3 && 是否是医美机构
- */
- // 未登录 || 非会员
- if(!this.hasLogin || !this.vipFlag === 1) return false
- // 商品所有机构可见
- if(pros.priceFlag === 0 ) return true
- // 商品价格仅资质机构可见
- if(pros.priceFlag === 2 && this.userIdentity === 2) return true
- // 商品价格仅医美机构可见
- if(pros.priceFlag === 3 && this.userIdentity === 2 && this.firstClubType == 1) return true
- // 其它
- return false
- },
- showAllBrands() {
- // 显示全部品牌
- this.isShowAllBrands = true
- this.brandLists = this.defaultBrandLists
- },
- choiceBrand(brand, index) {
- // 选择品牌
- brand.isChecked = !brand.isChecked
- if (brand.isChecked) {
- this.checkedBrandList.push(brand.id)
- } else {
- this.checkedBrandList.splice(index, 1)
- }
- this.isAllcheckedBrand = false
- this.checkedBrandLength = this.checkedBrandList.length
- console.log('checkedBrandList', this.checkedBrandList)
- this.listQuery.brandIds = this.checkedBrandList.join(',')
- console.log('this.listQuery.brandIds', this.listQuery.brandIds)
- },
- choiceBrandAll() {
- // 点击选择全部品牌
- this.isAllcheckedBrand = true
- this.listQuery.brandIds = ''
- this.brandLists.forEach(el => {
- el.isChecked = false
- })
- },
- choiceNewType() {
- // 选择筛选项新品
- this.isChoiceNewType = !this.isChoiceNewType
- if (this.isChoiceNewType) {
- this.listQuery.newFlag = 1
- } else {
- this.listQuery.newFlag = 0
- }
- },
- choiceActiType() {
- // 选择筛选项促销商品
- this.isChoiceActiType = !this.isChoiceActiType
- if (this.isChoiceActiType) {
- this.listQuery.promotionFlag = 1
- } else {
- this.listQuery.promotionFlag = 0
- }
- },
- SetScrollHeight() {
- let obj = {}
- const { windowHeight, pixelRatio } = wx.getSystemInfoSync()
- uni.getSystemInfo({
- success: res => {
- this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
- this.drawerH = res.windowHeight - uni.upx2px(180) - this.height
- }
- })
- this.windowHeight = windowHeight - 1
- this.scrollHeight = windowHeight - 1
- },
- setHeaderBtnPosi() {
- // 获得胶囊按钮位置信息
- let headerBtnPosi = uni.getMenuButtonBoundingClientRect()
- return headerBtnPosi
- },
- searchClickFn() {
- //弹出抽屉
- this.rightDrawer = true
- },
- closeDrawer(e) {
- //关闭抽屉
- this.rightDrawer = false
- },
- setSysteminfo() {
- let systeminfo
- uni.getSystemInfo({
- // 获取设备信息
- success: res => {
- systeminfo = res
- }
- })
- return systeminfo
- }
- },
- onPullDownRefresh() {
- setTimeout(() => {
- this.GetProductListInfo()
- uni.stopPullDownRefresh()
- }, 200)
- },
- onReachBottom() {
- if (this.totalPage > this.listData.length) {
- this.loadding = true
- this.pullUpOn = true
- this.GetOnReachBottomData()
- }
- },
- onShareAppMessage(res) {
- //分享转发
- if (res.from === 'button') {
- // 来自页面内转发按钮
- }
- return {
- title: `点击查看“${this.classData.name}”相关的商品`,
- path: `pages/goods/goods-classify?type=share&classType=${this.classifyType}&id=${this.listQuery.id}&title=${
- this.classData.name
- }`
- }
- },
- onShow() {}
- }
- </script>
- <style lang="scss">
- page {
- background: #ffffff;
- .all-type-list-wrapper {
- display: flex;
- flex-direction: column;
- }
- }
- .container-list {
- width: 100%;
- height: auto;
- }
- .all-type-list-content {
- height: 216rpx;
- padding: 24rpx;
- background: #fff;
- margin-bottom: 2rpx;
- display: flex;
- flex-direction: row;
- box-sizing: content-box;
- .list-details-image{
- width: 218rpx;
- height: 218rpx !important;
- margin-right: 26rpx;
- border-radius: 10rpx;
- border: 2rpx solid #f3f3f3;
- position: relative;
- .list-img {
- width: 218rpx;
- height: 218rpx !important;
- }
- .list-details-type{
- width: 64rpx;
- height: 64rpx;
- text-align: justify;
- box-sizing: border-box;
- padding: 10rpx;
- border-radius: 0 0 8rpx 8rpx;
- background-color: #33CCBF;
- font-size: $font-size-22;
- color: #FFFFFF;
- line-height: 25rpx;
- position: absolute;
- top: 0;
- right: 10rpx;
- }
- }
- }
- .list-details-info {
- width: 466rpx;
- display: flex;
- flex-direction: column;
- font-size: 26rpx;
- position: relative;
- .list-details-title {
- position: relative;
- .mclap {
- line-height: 38rpx;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- &.indent {
- text-indent: 95rpx;
- }
- }
- .mclap-tag {
- display: block;
- width: 84rpx;
- height: 32rpx;
- background-image: linear-gradient(270deg, #f9c023 0%, #f83600 100%);
- border-radius: 4rpx 48rpx 4px 4px;
- line-height: 32rpx;
- font-size: $font-size-22;
- color: #ffffff;
- text-align: center;
- position: absolute;
- left: 0;
- top: 0;
- }
- }
- .list-details-specs {
- margin-top: 8rpx;
- color: #666666;
- }
- .list-details-miniQuantity {
- margin-top: 7rpx;
- }
- }
- .list-details-price {
- width: 100%;
- height: 54rpx;
- line-height: 54rpx;
- position: absolute;
- bottom: -10rpx;
- right: 0;
- .floor-item-act {
- height: 54rpx;
- text-align: center;
- box-sizing: border-box;
- float: right;
- padding: 11rpx 0;
- }
- .price-icon {
- width: 22rpx;
- height: 28rpx;
- vertical-align: middle;
- margin-right: 10rpx;
- }
- .price-icon + text {
- font-size: 25rpx;
- vertical-align: middle;
- }
- .list-login-now {
- color: #f8c499;
- float: left;
- line-height: 54rpx;
- .p-no {
- float: left;
- font-size: $font-size-24;
- color: $text-color;
- }
- }
- .login-now {
- padding: 10rpx 10rpx 10rpx 0;
- }
- .list-price {
- color: #ff2a2a;
- height: 44rpx;
- float: left;
- .price-larger {
- width: 100%;
- height: 44rpx;
- font-size: 32rpx;
- &.none {
- text-decoration: line-through;
- color: #999999;
- }
- &.small {
- font-size: $font-size-24;
- }
- .txt {
- font-size: $font-size-24;
- display: inline-block;
- line-height: 44rpx;
- text-align: left;
- float: left;
- }
- }
- }
- .add-cart-btn {
- width: 156rpx;
- height: 64rpx;
- line-height: 64rpx;
- border-radius: 32rpx;
- color: #fff;
- font-size: 26rpx;
- margin-right: 0;
- background: linear-gradient(45deg, rgba(255, 41, 41, 1) 0%, rgba(255, 109, 27, 1) 100%);
- }
- }
- /*screen*/
- .tui-header-screen {
- width: 100%;
- box-sizing: border-box;
- background: #fff;
- position: fixed;
- z-index: 1000;
- /* padding-top: 12rpx; */
- }
- .tui-screen-top,
- .tui-screen-bottom {
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 28rpx;
- color: #999999;
- }
- .tui-screen-top {
- height: 88rpx;
- position: relative;
- background: #fff;
- border-bottom: 1px solid #efefef;
- }
- .tui-top-item {
- height: 28rpx;
- line-height: 28rpx;
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .icon-shangxiajiantou {
- font-size: 20rpx;
- color: #999999;
- margin-left: 8rpx;
- }
- .tui-topitem-active {
- color: #F3B574;
- }
- .tui-screen-bottom {
- height: 100rpx;
- padding: 0 30rpx;
- box-sizing: border-box;
- font-size: 24rpx;
- align-items: center;
- overflow: hidden;
- }
- .tui-bottom-text {
- line-height: 26rpx;
- max-width: 82%;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .tui-bottom-item {
- flex: 1;
- width: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0 12rpx;
- box-sizing: border-box;
- background: #f7f7f7;
- margin-right: 20rpx;
- white-space: nowrap;
- height: 60rpx;
- border-radius: 40rpx;
- }
- .tui-bottom-item:last-child {
- margin-right: 0;
- }
- .tui-btmItem-active {
- background: #fcedea !important;
- color: #F3B574;
- font-weight: bold;
- position: relative;
- }
- .tui-btmItem-active::after {
- content: '';
- position: absolute;
- border: 1rpx solid #F3B574;
- width: 100%;
- height: 100%;
- border-radius: 40rpx;
- left: 0;
- top: 0;
- }
- .tui-btmItem-tap {
- position: relative;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
- }
- .tui-btmItem-tap::after {
- content: '';
- position: absolute;
- width: 100%;
- height: 22rpx;
- background: #f7f7f7;
- left: 0;
- top: 58rpx;
- }
- .tui-active {
- color: #F3B574;
- }
- .tui-icon-ml .tui-icon-class {
- margin-left: 6rpx;
- }
- .tui-ml {
- margin-left: 6rpx;
- }
- .tui-seizeaseat-20 {
- height: 20rpx;
- }
- .tui-seizeaseat-30 {
- height: 30rpx;
- }
- .tui-icon-middle .tui-icon-class {
- vertical-align: middle;
- }
- .tui-middle {
- vertical-align: middle;
- }
- /*screen*/
- .drawer-container {
- width: 580rpx;
- height: 100%;
- padding: 80rpx 0;
- overflow: hidden;
- box-sizing: border-box;
- background-color: #f7f7f7;
- .drawer-title {
- width: 100%;
- height: 72rpx;
- line-height: 72rpx;
- box-sizing: border-box;
- padding: 0 30rpx;
- float: left;
- background-color: #f7f7f7;
- .drawer-title-h1 {
- font-size: $font-size-26;
- color: #F3B574;
- font-weight: bold;
- text-align: left;
- float: left;
- }
- .drawer-title-p {
- font-size: $font-size-24;
- float: right;
- color: #333333;
- .text {
- color: #F3B574;
- }
- }
- }
- .drawer-main {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- float: left;
- .drawer-main-cell {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 12rpx 24rpx 24rpx 24rpx;
- background-color: #ffffff;
- .drawer-item-cell {
- width: 100%;
- height: auto;
- float: left;
- .drawer-item-title {
- width: 100%;
- height: 82rpx;
- line-height: 82rpx;
- text-align: left;
- font-size: $font-size-26;
- color: $text-color;
- float: left;
- }
- .drawer-item-main {
- width: 100%;
- height: auto;
- float: left;
- &.none {
- margin-top: 24rpx;
- }
- .drawer-item-text {
- display: inline-block;
- float: left;
- padding: 0 30rpx;
- height: 56rpx;
- border-radius: 28rpx;
- background-color: #f7f7f7;
- line-height: 56rpx;
- text-align: center;
- color: #999999;
- font-size: $font-size-26;
- margin-right: 24rpx;
- margin-bottom: 24rpx;
- &.checked {
- background-color: #fef6f3;
- color: $color-system;
- }
- }
- }
- }
- }
- .drawer-main-brand {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 12rpx 24rpx 24rpx 24rpx;
- background-color: #ffffff;
- .drawer-brand-list {
- width: 160rpx;
- height: 56rpx;
- line-height: 56rpx;
- text-align: center;
- font-size: 26rpx;
- background-color: #f7f7f7;
- color: #999999;
- border-radius: 30rpx;
- box-sizing: border-box;
- padding: 0 15rpx;
- float: left;
- margin: 12rpx 24rpx 12rpx 0;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- line-clamp: 1;
- -webkit-box-orient: vertical;
- &.checked {
- background-color: #fef6f3;
- color: #F3B574;
- }
- &:nth-child(3n) {
- margin-right: 0;
- }
- }
- .drawer-brand-more {
- width: 100%;
- height: 42rpx;
- line-height: 42rpx;
- float: left;
- font-size: $font-size-24;
- color: #999999;
- text-align: center;
- }
- }
- .drawer-main-radio {
- width: 100%;
- height: 72rpx;
- background-color: #ffffff;
- margin-top: 20rpx;
- box-sizing: border-box;
- padding: 0 24rpx;
- .drawer-radio-name {
- float: left;
- line-height: 72rpx;
- font-size: $font-size-26;
- color: #333333;
- }
- .drawer-radio-input {
- width: 72rpx;
- height: 72rpx;
- float: right;
- line-height: 72rpx;
- text-align: right;
- .iconfont {
- font-size: $font-size-36;
- &.icon-weixuanze {
- color: #b2b2b2;
- }
- &.icon-yixuanze {
- color: #F3B574;
- }
- }
- }
- }
- }
- .drawer-input {
- width: 100%;
- float: left;
- box-sizing: border-box;
- padding: 24rpx 10rpx 0 10rpx;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 4rpx;
- position: relative;
- background-color: #ffffff;
- &.btn {
- border: none;
- display: flex;
- position: fixed;
- left: 0;
- bottom: 0;
- }
- .drawer-btn {
- width: 210rpx;
- height: 84rpx;
- border-radius: 42rpx;
- background: $btn-confirm;
- line-height: 84rpx;
- text-align: center;
- font-size: $font-size-26;
- color: #ffffff;
- flex: 1;
- margin: 0 10rpx;
- &.comfrim {
- background: $btn-confirm;
- }
- &.clear {
- background: #e1e1e1;
- }
- }
- }
- }
- </style>
|