my-product.vue 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201
  1. <template>
  2. <view class="container product clearfix">
  3. <view class="superv-header">
  4. <view class="superv-header-click" v-if="!isSuperv">
  5. <view class="oltext" @click="supervClickFn">管理</view>
  6. <view class="ortext" @click="searchClickFn">筛选</view>
  7. </view>
  8. <view class="superv-header-checked" v-else>
  9. <view class="oltext" @click="isCheckedAll">
  10. <view class="checkbox iconfont" :class="[isAllChecked ?'icon-yixuanze':'icon-weixuanze']"></view>
  11. <view class="text">全选</view>
  12. </view>
  13. <view class="ortext" @click="closeSupervFn">完成</view>
  14. </view>
  15. </view>
  16. <view class="product-content">
  17. <view :class="{'tui-order-list':scrollTop >= 0}" class="clearfix">
  18. <!-- 空白页 -->
  19. <view class="empty-container" v-if="isEmpty">
  20. <image class="empty-container-image" src="https://img.caimei365.com/group1/M00/03/71/Cmis2F3wna6AY2ZjAABpmnBICH4247.png"></image>
  21. <text class="error-text">暂未发布任何商品~</text>
  22. </view>
  23. <!-- 列表 -->
  24. <checkbox-group @change="buyChange" class="tui-group">
  25. <view class="tui-cart-cell tui-mtop" v-for="(item,index) in dataList" :key="index">
  26. <tui-swipe-actions :actions="item.actions" @click="handlerButton($event,item)" :params="item">
  27. <template v-slot:content>
  28. <view class="tui-goods-item">
  29. <view class="tui-goods-checkBox" v-if="isSuperv">
  30. <view class="checkbox iconfont" :class="[item.isChecked ?'icon-yixuanze':'icon-weixuanze']" @click="checkedSoperv(item)"></view>
  31. </view>
  32. <view class="tui-goods-image">
  33. <image :src="item.image" class="tui-goods-img"/>
  34. </view>
  35. <view class="tui-goods-info" :style="{width:isSuperv ? '360rpx' : '420rpx'}">
  36. <view class="tui-goods-title">{{ item.name }}</view>
  37. <view class="tui-price-box">
  38. <view class="tui-goods-price">¥{{item.price | NumFormat}}</view>
  39. </view>
  40. <view class="tui-goods-pip">市场价:¥{{item.normalPrice | NumFormat}}</view>
  41. <view class="tui-goods-pip">新品展示: <text class="red">{{ item.showFlag | newvalidFlagFilters }}</text> </view>
  42. <view class="tui-goods-pip">分类:{{ item.typeName ? item.typeName : '无' }}</view>
  43. </view>
  44. <view class="tui-goods-status">
  45. <view class="status-text" :style="{ color: verifyColorFilter(item.validFlag)}">
  46. {{ item.validFlag | verifyStatusFilter }}
  47. </view>
  48. </view>
  49. </view>
  50. </template>
  51. </tui-swipe-actions>
  52. </view>
  53. </checkbox-group>
  54. <!--加载loadding-->
  55. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  56. <tui-nomore :visible="!pullUpOn" :backgroundColor="'#ffffff'" :text='nomoreText'></tui-nomore>
  57. <!--加载loadding-->
  58. </view>
  59. </view>
  60. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :content="contentModalText" color="#333" :size="32" shape="circle" :maskClosable="false"></tui-modal>
  61. <!--右抽屉-->
  62. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  63. <view class="d-container clearfix" :style="{paddingTop:CustomBar+10+'px'}">
  64. <scroll-view class="tui-popup-scroll" scroll-y="true">
  65. <view class="d-label">商品名称:</view>
  66. <view class="d-input">
  67. <input class="input" type="text" value="" v-model="listQuery.name" placeholder="输入商品名称"/>
  68. </view>
  69. <view class="d-label">商品货号:</view>
  70. <view class="d-input">
  71. <input class="input" type="text" value="" v-model="listQuery.productCode" placeholder="输入商品货号"/>
  72. </view>
  73. <view class="d-label">状态:</view>
  74. <view class="d-input">
  75. <picker @change="bindPickerChange(1,$event)" :value="index" :range="statusActions" range-key="name">
  76. <input class="input" type="text" disabled="false" v-model="validFlagText" value="" placeholder="请选择审核状态"/>
  77. <text class="iconfont icon-xiangyou"></text>
  78. </picker>
  79. </view>
  80. <view class="d-label">主推商品:</view>
  81. <view class="d-input">
  82. <picker @change="bindPickerChange(2,$event)" :value="index" :range="recommendActions" range-key="name">
  83. <input class="input" type="text" disabled="false" v-model="featuredFlagText" value="" placeholder="请选择"/>
  84. <text class="iconfont icon-xiangyou"></text>
  85. </picker>
  86. </view>
  87. <view class="d-label">商品属性:</view>
  88. <view class="d-input">
  89. <picker @change="bindPickerChange(0,$event)" :value="index" :range="commodityTypeActons" range-key="name">
  90. <input class="input" type="text" disabled="false" v-model="commodityTypeText" value="" placeholder="请选择"/>
  91. <text class="iconfont icon-xiangyou"></text>
  92. </picker>
  93. </view>
  94. <view class="d-label">商品分类:</view>
  95. <view class="d-input">
  96. <picker @change="bindPickerChange(3,$event)" :value="index" :range="classificationFirstList" range-key="name">
  97. <input class="input" type="text" disabled="false" v-model="firstClassificationText" value="" placeholder="请选择一分类"/>
  98. <text class="iconfont icon-xiangyou"></text>
  99. </picker>
  100. </view>
  101. <view class="d-input">
  102. <picker @change="bindPickerChange(4,$event)" :value="index" :range="classificationTwoList" range-key="name">
  103. <input class="input" type="text" disabled="false" v-model="twoClassificationText" value="" placeholder="请选择二级分类"/>
  104. <text class="iconfont icon-xiangyou"></text>
  105. </picker>
  106. </view>
  107. <view class="d-input">
  108. <picker @change="bindPickerChange(5,$event)" :value="index" :range="classificationThreeList" range-key="name">
  109. <input class="input" type="text" disabled="false" v-model="threeClassificationText" value="" placeholder="请选择三级分类"/>
  110. <text class="iconfont icon-xiangyou"></text>
  111. </picker>
  112. </view>
  113. <view class="d-label">新品展示:</view>
  114. <view class="d-input">
  115. <picker @change="bindPickerChange(6,$event)" :value="index" :range="newFlagActions" range-key="name">
  116. <input class="input" type="text" disabled="false" v-model="newvalidFlagText" value="" placeholder="请选择"/>
  117. <text class="iconfont icon-xiangyou"></text>
  118. </picker>
  119. </view>
  120. <view class="d-input btn">
  121. <view class="d-btn comfrim" @click="handSearchList">确定</view>
  122. <view class="d-btn clear" @click="handSearchClear">重置</view>
  123. </view>
  124. </scroll-view>
  125. </view>
  126. </tui-drawer>
  127. <!-- 批量操作 -->
  128. <tui-bottom-popup :radius="false" :mask="false" :show="isSuperv">
  129. <view class="tui-popup-box clearfix">
  130. <view class="tui-right-flex tui-popup-btn" :style="{ paddingBottom :isIphoneX ? '68rpx' : '0rpx' }">
  131. <view class="tui-flex-1">
  132. <view class="tui-button" :class="isProductChecked ? 'active' : ''" @click="handleAllUnder()">批量下架</view>
  133. </view>
  134. </view>
  135. </view>
  136. </tui-bottom-popup>
  137. </view>
  138. </template>
  139. <script>
  140. import tuiLoadmore from '@/components/tui-components/loadmore/loadmore'
  141. import tuiNomore from '@/components/tui-components/nomore/nomore'
  142. import modalLayer from '@/components/modal-layer'
  143. import { mapState,mapMutations } from 'vuex'
  144. const defaultListQuery = {
  145. shopId:'',
  146. pageNum:1,
  147. pageSize:10,
  148. productCode:'',//货号
  149. name:'',//商品名称
  150. validFlag:'',//状态
  151. newvalidFlag:'',//新品展示状态
  152. featuredFlag:'',//是否主推
  153. commodityType:'',//商品属性
  154. bigTypeId:0,//一级
  155. smallTypeId:0,//二级
  156. tinyTypeId:0//三级
  157. }
  158. export default{
  159. components: {
  160. tuiLoadmore,
  161. tuiNomore
  162. },
  163. data() {
  164. return{
  165. shopId:0,
  166. isSuperv:false,
  167. isProductChecked:false,
  168. validFlagText:'',
  169. featuredFlagText:'',
  170. newvalidFlagText:'',
  171. commodityTypeText:'产品',//预览商品属性
  172. firstClassificationText:'',
  173. twoClassificationText:'',
  174. threeClassificationText:'',
  175. recommendActions: [{name:'是',value:1},{name: '否',value:0}],
  176. commodityTypeActons: [{name:'产品',value:1},{name: '仪器',value:2}],
  177. newFlagActions: [
  178. {name:'全部',value:''},
  179. {name: '待审核',value:0},
  180. {name: '已展示',value:1},
  181. {name: '展示过期',value:2},
  182. {name: '未展示',value:3},
  183. {name: '审核未通过',value:4},
  184. {name: '已下线',value:5}
  185. ],
  186. statusActions: [
  187. {name:'全部',value:''},
  188. {name: '未审核',value:1},
  189. {name: '审核未通过',value:8},
  190. {name: '已上架',value:2},
  191. {name: '已下架',value:3},
  192. {name: '已冻结',value:10},
  193. {name: '已隐身',value:9},
  194. {name: '已删除',value:0},
  195. ],
  196. classificationFirstList:[],
  197. classificationTwoList:[],
  198. classificationThreeList:[],
  199. currents:0,
  200. userID:0,
  201. listQuery:Object.assign({}, defaultListQuery),
  202. dataList: [],
  203. btnoRderID: 0, //点击按钮传入的的订单ID
  204. scrollTop: 0,
  205. deteleType:'',
  206. skeletonShow: true,
  207. isEmpty: false,
  208. isDelete:false,
  209. isAllChecked:false,
  210. isModalLayer: false,
  211. loadding: false,
  212. pullUpOn: true,
  213. pullFlag: true,
  214. hasNextPage: false,
  215. navbarHeight:'',
  216. nomoreText: '上拉显示更多',
  217. contentModalText:'',//操作文字提示语句
  218. modal:false,
  219. rightDrawer: false,
  220. handlerProduct:{},//储存监听商品信息
  221. OperationType:'',//操作类型
  222. isCmcustomClass : 'left',
  223. featuredNum:0,
  224. productIds:'',//批量下架操作商品ID
  225. }
  226. },
  227. onLoad(option){
  228. switch(option.listType){
  229. case '0':
  230. this.listQuery.validFlag =''
  231. break
  232. case '1':
  233. this.listQuery.validFlag = 2
  234. break
  235. case '2':
  236. this.listQuery.validFlag = 3
  237. break
  238. }
  239. this.$api.getComStorage('userInfo').then((resolve) =>{
  240. this.listQuery.shopId = this.shopId = resolve.shopId
  241. this.GetProductListInfo()
  242. })
  243. },
  244. filters: {
  245. NumFormat:function(text) {//处理金额
  246. return Number(text).toFixed(2)
  247. },
  248. verifyStatusFilter: function(state){
  249. let stateText = '',
  250. stateTextObject={
  251. 0:'已删除',
  252. 1:'待审核',
  253. 2:'已上架',
  254. 3:'已下架',
  255. 8:'审核未通过',
  256. 9:'已隐身',
  257. 10:'已冻结',
  258. }
  259. Object.keys(stateTextObject).forEach(function(key) {
  260. if(key == state){
  261. stateText = stateTextObject[key]
  262. }
  263. })
  264. return stateText
  265. },
  266. newvalidFlagFilters(value) {
  267. //新品展示状态
  268. const map = {
  269. 0: '待审核',
  270. 1: '已展示',
  271. 2: '展示过期',
  272. 3: '未展示',
  273. 4: '审核未通过',
  274. 5: '已下线'
  275. }
  276. return map[value]
  277. }
  278. },
  279. computed: {
  280. ...mapState(['hasLogin','userInfo'])
  281. },
  282. methods:{
  283. ...mapMutations(['login','logout']),
  284. GetProductListInfo(){
  285. this.listQuery.pageNum = 1
  286. this.ShopService.GetSupplierPyProduct(this.listQuery).then(response =>{
  287. let data = response.data.productPage
  288. this.featuredNum = response.data.featuredNum
  289. this.hasNextPage = data.hasNextPage
  290. if(data.results && data.results.length > 0){
  291. this.isEmpty = false
  292. this.dataList = data.results
  293. this.handleDataList()
  294. if(this.hasNextPage){
  295. this.pullUpOn = false
  296. this.nomoreText = '上拉显示更多'
  297. }else{
  298. if(this.dataList.length < 5){
  299. this.pullUpOn = true
  300. }else{
  301. this.pullUpOn = false
  302. this.nomoreText = '已至底部'
  303. }
  304. }
  305. this.GetPrimaryClassification(this.listQuery.commodityType)
  306. }else{
  307. this.dataList = []
  308. this.isEmpty = true
  309. this.pullUpOn = true
  310. }
  311. }).catch(error =>{
  312. this.$util.msg(error.msg,2000)
  313. })
  314. },
  315. GetOnReachBottomData(index){//上拉加载
  316. this.listQuery.pageNum += 1
  317. this.ShopService.GetSupplierPyProduct(this.listQuery).then(response =>{
  318. let data = response.data.productPage
  319. this.featuredNum = response.data.featuredNum
  320. this.hasNextPage = data.hasNextPage
  321. this.dataList = this.dataList.concat(data.results)
  322. this.handleDataList()
  323. this.pullFlag = false// 防上拉暴滑
  324. setTimeout(()=>{this.pullFlag = true},500)
  325. if(this.hasNextPage){
  326. this.pullUpOn = false
  327. this.nomoreText = '上拉显示更多'
  328. }else{
  329. this.loadding = false
  330. this.pullUpOn = false
  331. this.nomoreText = '已至底部'
  332. }
  333. })
  334. },
  335. handleDataList(){//根据商品状态set不同的tabAction返回新的数据
  336. this.dataList.forEach(item =>{
  337. if(item.validFlag === 0 || item.validFlag === 3 || item.validFlag === 8 || item.validFlag === 9){
  338. item.actions = [
  339. {name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
  340. ]
  341. }else if(item.validFlag === 1 || item.validFlag === 10){
  342. item.actions = [
  343. {name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
  344. ]
  345. }else if(item.validFlag === 2){
  346. if(item.featuredFlag ===1){
  347. item.actions = [
  348. {name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
  349. {name: '删除主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
  350. {name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'},
  351. ]
  352. }else{
  353. item.actions = [
  354. {name: '查看详情',color: '#fff',fontsize: 26,width: 50,background: '#f9a94b'},
  355. {name: '添加主页推荐',color: '#fff',fontsize: 26,width: 50,background: '#ff7a51'},
  356. {name: '下架',color: '#fff',fontsize: 26,width: 50,background: '#fea785'},
  357. ]
  358. }
  359. }
  360. })
  361. console.log(this.dataList)
  362. },
  363. handSearchList(){//搜索
  364. this.GetProductListInfo()
  365. this.leftDrawer = false
  366. this.rightDrawer = false
  367. },
  368. handSearchClear(){//重置搜索条件
  369. this.listQuery = Object.assign({}, defaultListQuery)
  370. this.listQuery.shopId = this.shopId
  371. this.validFlagText=''
  372. this.featuredFlagText=''
  373. this.newvalidFlagText=''
  374. this.commodityTypeText=''
  375. this.firstClassificationText=''
  376. this.twoClassificationText=''
  377. this.threeClassificationText=''
  378. this.classificationTwoList = []
  379. this.classificationThreeList = []
  380. },
  381. handlerButton(e,item){//监听侧滑按钮点击事件
  382. if(item.validFlag === 0 || item.validFlag === 3 || item.validFlag === 8 || item.validFlag === 9){
  383. if(e.index == 0){
  384. return
  385. }
  386. }else if(item.validFlag === 1 || item.validFlag === 10){
  387. if(e.index == 0){
  388. this.$api.navigateTo(`/pages/goods/product?id=${item.productId}`)
  389. }
  390. }else if(item.validFlag === 2){
  391. switch(e.index){
  392. case 0:
  393. this.$api.navigateTo(`/pages/goods/product?id=${item.productId}`)
  394. break
  395. case 1:
  396. if(item.featuredFlag === 1){
  397. this.handleDeleteShopRemb(item)
  398. }else{
  399. this.handleAddShopRemb(item)
  400. }
  401. break
  402. case 2:
  403. this.handleUnder(item)
  404. }
  405. }
  406. },
  407. handleAddShopRemb(item){//添加主页推荐
  408. let num = 4- this.featuredNum
  409. this.OperationType = 'add'
  410. this.handlerProduct = item
  411. this.modal = true
  412. this.contentModalText = `总共能添加4个主推商品,您还能添加${num}个确定将该商品添加为主推商品吗?`
  413. },
  414. handleDeleteShopRemb(item){//删除主页推荐
  415. this.OperationType = 'delete'
  416. this.handlerProduct = item
  417. this.modal = true
  418. this.contentModalText = '是否把该商品从主推商品中删除?'
  419. },
  420. handleUnder(item){//下架操作
  421. this.OperationType = 'under'
  422. this.handlerProduct = item
  423. this.modal = true
  424. this.contentModalText = '确定下架该商品吗?'
  425. },
  426. handleAllUnder(){//批量下架操作
  427. let checkedArray = []
  428. let isValidFlag = false
  429. this.productIds = ''
  430. if(this.isProductChecked){
  431. this.dataList.forEach(el => {
  432. if(el.isChecked) {
  433. checkedArray.push(el)
  434. }
  435. })
  436. checkedArray.forEach(el =>{
  437. if(el.validFlag == 2){
  438. this.productIds += el.productId+','
  439. }
  440. if(el.validFlag != 2){
  441. isValidFlag = true
  442. }
  443. })
  444. if(isValidFlag){
  445. this.$util.modal('','部分选中的商品暂未上架,不能进行下架操作','确定','',false,() =>{})
  446. return
  447. }
  448. this.OperationType = 'allunder'
  449. this.modal = true
  450. this.contentModalText = '确定下架选中的商品吗?'
  451. }
  452. },
  453. handleClick(e) {//弹窗提示用户操作
  454. if(e.index == 1){
  455. switch(this.OperationType){
  456. case 'delete'://删除主页推荐
  457. this.SupplierDeleteSwitchFeatured(this.handlerProduct)
  458. break
  459. case 'add'://添加主页推荐
  460. this.SupplierAddSwitchFeatured(this.handlerProduct)
  461. break
  462. case 'under'://下架商品
  463. this.SupplierSoldOutProduct(this.handlerProduct)
  464. break
  465. case 'allunder'://批量下架
  466. this.SupplierAllSoldOutProduct(this.productIds)
  467. break
  468. }
  469. }
  470. this.modal = false
  471. },
  472. SupplierDeleteSwitchFeatured(item){//操作删除主页推荐
  473. this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productId,featuredFlag:0}).then(response =>{
  474. this.$util.msg('删除成功',2000,true,'success')
  475. setTimeout(() => {
  476. this.GetProductListInfo()
  477. },2000)
  478. }).catch(error =>{
  479. this.$util.msg(error.msg,2000)
  480. })
  481. },
  482. SupplierAddSwitchFeatured(item){//操作添加主页推荐
  483. this.ShopService.SupplierSwitchFeaturedyProduct({productId:item.productId,featuredFlag:1}).then(response =>{
  484. this.$util.msg('添加成功',2000,true,'success')
  485. setTimeout(() => {
  486. this.GetProductListInfo()
  487. },2000)
  488. }).catch(error =>{
  489. this.$util.msg(error.msg,2000)
  490. })
  491. },
  492. SupplierSoldOutProduct(item){//操作下架商品
  493. this.ShopService.SupplierSoldOutProduct({productIds:item.productId}).then(response =>{
  494. this.$util.msg('下架成功',2000,true,'success')
  495. setTimeout(() => {
  496. this.GetProductListInfo()
  497. },2000)
  498. }).catch(error =>{
  499. this.$util.msg(error.msg,2000)
  500. })
  501. },
  502. SupplierAllSoldOutProduct(ids){//操作批量下架商品
  503. this.ShopService.SupplierSoldOutProduct({productIds:ids}).then(response =>{
  504. this.$util.msg('下架成功',2000,true,'success')
  505. this.productIds = ''
  506. setTimeout(() => {
  507. this.GetProductListInfo()
  508. },2000)
  509. }).catch(error =>{
  510. this.$util.msg(error.msg,2000)
  511. })
  512. },
  513. bindPickerChange: function(type,e) {//选择筛选条件
  514. switch(type){
  515. case 0:
  516. this.commodityTypeText = this.statusActions[e.target.value].name
  517. this.listQuery.commodityType = this.commodityTypeActons[e.target.value].value
  518. break
  519. case 1:
  520. this.validFlagText = this.statusActions[e.target.value].name
  521. this.listQuery.validFlag = this.statusActions[e.target.value].value
  522. break
  523. case 2:
  524. this.featuredFlagText = this.recommendActions[e.target.value].name
  525. this.listQuery.featuredFlag = this.recommendActions[e.target.value].value
  526. break
  527. case 3:
  528. this.firstClassificationText = this.classificationFirstList[e.target.value].name
  529. this.listQuery.bigTypeId = this.classificationFirstList[e.target.value].value
  530. this.GetPrimarySecondaryClassification(this.listQuery.bigTypeId)
  531. this.twoClassificationText = ''
  532. this.threeClassificationText=''
  533. break
  534. case 4:
  535. if(this.listQuery.bigTypeId == 0){
  536. this.$util.msg('请先选择一级分类',2000)
  537. return
  538. }
  539. this.twoClassificationText = this.classificationTwoList[e.target.value].name
  540. this.listQuery.smallTypeId = this.classificationTwoList[e.target.value].value
  541. this.GetPrimaryThreeLevelClassification(this.listQuery.smallTypeId)
  542. break
  543. case 5:
  544. if(this.listQuery.smallTypeId == 0){
  545. this.$util.msg('请先选择二级分类',2000)
  546. return
  547. }
  548. this.threeClassificationText = this.classificationThreeList[e.target.value].name
  549. this.listQuery.tinyTypeId = this.classificationThreeList[e.target.value].value
  550. break
  551. case 6:
  552. this.newvalidFlagText = this.newFlagActions[e.target.value].name
  553. this.listQuery.newvalidFlag = this.newFlagActions[e.target.value].value
  554. break
  555. }
  556. },
  557. GetPrimaryClassification(value){//获取筛选条件一级分类
  558. this.ShopService.GetPrimaryClassification({typeSort:value}).then(response =>{
  559. const data = response.data
  560. data.forEach(item =>{
  561. let _obj = {name:item.name,value:item.bigTypeID}
  562. this.classificationFirstList.push(_obj)
  563. })
  564. }).catch(error =>{
  565. this.$util.msg(error.msg,2000)
  566. })
  567. },
  568. GetPrimarySecondaryClassification(value){//获取筛选条件二级分类
  569. this.classificationTwoList = []
  570. this.ShopService.GetPrimarySecondaryClassification({bigTypeId:value}).then(response =>{
  571. const data = response.data
  572. data.forEach(item =>{
  573. let _obj = {name:item.name,value:item.smallTypeID}
  574. this.classificationTwoList.push(_obj)
  575. })
  576. }).catch(error =>{
  577. this.$util.msg(error.msg,2000)
  578. })
  579. },
  580. GetPrimaryThreeLevelClassification(value){//获取筛选条件三级分类
  581. this.classificationThreeList = []
  582. this.ShopService.GetPrimaryThreeLevelClassification({smallTypeId:value}).then(response =>{
  583. const data = response.data
  584. data.forEach(item =>{
  585. let _obj = {name:item.name,value:item.tinyTypeID}
  586. this.classificationThreeList.push(_obj)
  587. })
  588. }).catch(error =>{
  589. this.$util.msg(error.msg,2000)
  590. })
  591. },
  592. hideMobel(){
  593. this.modal = false
  594. },
  595. updateCheckAllBtn() {//勾选单个判断全选
  596. let goodsCheckedLength = 0
  597. this.dataList.forEach(item => {
  598. if(item.isChecked) { goodsCheckedLength++ }
  599. })
  600. this.isAllChecked = goodsCheckedLength === this.dataList.length
  601. if(goodsCheckedLength>0){
  602. this.isProductChecked = true
  603. }else{
  604. this.isProductChecked = false
  605. }
  606. },
  607. updateBothCheckBtn() {//全选勾选判断
  608. this.dataList.forEach((item)=>{
  609. item.isChecked = this.isAllChecked
  610. })
  611. },
  612. isCheckedAll(){//全选
  613. this.isAllChecked = !this.isAllChecked
  614. if(this.isAllChecked){
  615. this.isProductChecked = true
  616. }else{
  617. this.isProductChecked = false
  618. }
  619. this.updateBothCheckBtn()
  620. },
  621. checkedSoperv(item){//选择
  622. item.isChecked = !item.isChecked
  623. console.log(item)
  624. this.updateCheckAllBtn()
  625. },
  626. supervClickFn(){//管理全选
  627. this.isSuperv = true
  628. },
  629. closeSupervFn(){
  630. this.isSuperv = false
  631. },
  632. searchClickFn() {//弹出抽屉
  633. this.rightDrawer = true
  634. },
  635. closeDrawer(e) {//关闭抽屉
  636. this.leftDrawer = false
  637. this.rightDrawer = false
  638. },
  639. orderPriceToFixed (n){
  640. let price =''
  641. price = Number(n).toFixed(2)
  642. return price
  643. },
  644. verifyColorFilter: function(state){
  645. let stateColor = '',
  646. stateColorObject={
  647. 0:'#FFB12A',
  648. 1:'#f9a94b',
  649. 2:'#1890f9',
  650. 3:'#627386',
  651. 8:'#FF2A2A',
  652. 9:'#f94b4b'
  653. }
  654. Object.keys(stateColorObject).forEach(function(key){
  655. if(key == state){
  656. stateColor = stateColorObject[key]
  657. }
  658. })
  659. return stateColor
  660. },
  661. },
  662. onPageScroll(e){//实时获取到滚动的值
  663. if(e.scrollTop>30){
  664. this.isCmcustomClass = 'fiexd'
  665. }else{
  666. this.isCmcustomClass = 'left'
  667. }
  668. },
  669. onReachBottom() {
  670. if(this.hasNextPage){
  671. this.loadding = true
  672. this.pullUpOn = true
  673. this.GetOnReachBottomData()
  674. }
  675. },
  676. onPullDownRefresh() {
  677. setTimeout(() => {
  678. this.listQuery.pageNum = 1
  679. uni.stopPullDownRefresh()
  680. }, 200)
  681. },
  682. onShow(){
  683. }
  684. }
  685. </script>
  686. <style lang="scss">
  687. @import "@/uni.scss";
  688. page{
  689. background:#FFF;
  690. }
  691. .empty-container{
  692. z-index: 9999;
  693. }
  694. .superv-header{
  695. width: 100%;
  696. height: 80rpx;
  697. background-color: #F7F7F7;
  698. line-height: 80rpx;
  699. position: fixed;
  700. top: 0;
  701. left: 0;
  702. box-sizing: border-box;
  703. padding: 0 24rpx;
  704. z-index: 999;
  705. .superv-header-click{
  706. width: 100%;
  707. height: 80rpx;
  708. font-size: $font-size-30;
  709. .oltext{
  710. width: 120rpx;
  711. float: left;
  712. color: #666666;
  713. }
  714. .ortext{
  715. width: 120rpx;
  716. float: right;
  717. color: $color-system;
  718. text-align: right;
  719. }
  720. }
  721. .superv-header-checked{
  722. width: 100%;
  723. height: 80rpx;
  724. font-size: $font-size-30;
  725. .oltext{
  726. width: 120rpx;
  727. float: left;
  728. color: #666666;
  729. display: flex;
  730. margin-left: 10rpx;
  731. .checkbox{
  732. display: flex;
  733. margin: 0;
  734. padding: 0;
  735. display: flex;
  736. flex-direction: column;
  737. align-items: center;
  738. box-sizing: border-box;
  739. text-align: center;
  740. text-decoration: none;
  741. border-radius: 0;
  742. -webkit-tap-highlight-color: transparent;
  743. overflow: hidden;
  744. font-size: 34rpx;
  745. color:$color-system;
  746. line-height: 80rpx;
  747. }
  748. .text{
  749. float: left;
  750. line-height: 80rpx;
  751. margin-left: 15rpx;
  752. }
  753. }
  754. .ortext{
  755. width: 120rpx;
  756. float: right;
  757. color: $color-system;
  758. text-align: right;
  759. }
  760. }
  761. }
  762. .d-container {
  763. width: 560rpx;
  764. padding: 80rpx 30rpx;
  765. .tui-popup-scroll{
  766. width: 100%;
  767. height: auto;
  768. }
  769. .d-title{
  770. width: 100%;
  771. height:80rpx;
  772. line-height: 80rpx;
  773. text-align: center;
  774. color: #4688fa;
  775. font-size: $font-size-32;
  776. float: left;
  777. }
  778. .d-time{
  779. width: 100%;
  780. height: 70rpx;
  781. float: left;
  782. box-sizing: border-box;
  783. padding: 0 10rpx;
  784. border: 1px solid rgba(0,0,0,0.2);
  785. border-radius: 4rpx;
  786. margin-bottom: 30rpx;
  787. .iconfont{
  788. width:70rpx;
  789. height: 60rpx;
  790. display: block;
  791. float: left;
  792. font-size: 50rpx;
  793. color: #666666;
  794. line-height: 70rpx;
  795. text-align: left;
  796. }
  797. .input{
  798. width: 220rpx;
  799. height: 70rpx;
  800. line-height: 70rpx;
  801. float: left;
  802. box-sizing: border-box;
  803. font-size: $font-size-24;
  804. color: #333333;
  805. padding: 0 10rpx;
  806. }
  807. }
  808. .d-label{
  809. width: 100%;
  810. height: 44rpx;
  811. line-height: 44rpx;
  812. text-align: left;
  813. color: #666666;
  814. font-size: $font-size-26;
  815. float: left;
  816. }
  817. .d-input{
  818. width: 100%;
  819. height: 70rpx;
  820. float: left;
  821. box-sizing: border-box;
  822. padding: 0 10rpx;
  823. border: 1px solid rgba(0,0,0,0.2);
  824. border-radius: 4rpx;
  825. margin-bottom: 30rpx;
  826. position: relative;
  827. &.btn{
  828. border: none;
  829. margin-top: 40rpx;
  830. }
  831. .input{
  832. width: 100%;
  833. height: 70rpx;
  834. line-height: 70rpx;
  835. float: left;
  836. box-sizing: border-box;
  837. font-size: $font-size-24;
  838. color: #333333;
  839. padding: 0 10rpx;
  840. padding-right: 68rpx;
  841. }
  842. .iconfont{
  843. width: 50rpx;
  844. height: 68rpx;
  845. display: block;
  846. line-height: 68rpx;
  847. text-align: center;
  848. font-size: 30rpx;
  849. color: #999999;
  850. position: absolute;
  851. right: 0;
  852. top: 0;
  853. }
  854. .d-btn{
  855. width: 210rpx;
  856. height: 84rpx;
  857. border-radius: 42rpx;
  858. background: $btn-confirm;
  859. line-height: 84rpx;
  860. text-align: center;
  861. font-size: $font-size-26;
  862. color: #FFFFFF;
  863. float: right;
  864. &.comfrim{
  865. background: $btn-confirm;
  866. margin-left: 20rpx;
  867. }
  868. &.clear{
  869. background: #e1e1e1;
  870. }
  871. }
  872. }
  873. }
  874. .tui-header {
  875. width: 100%;
  876. font-size: 16px;
  877. font-weight: 500;
  878. height: 32px;
  879. display: flex;
  880. align-items: center;
  881. justify-content: center;
  882. position: relative;
  883. padding: 0 40rpx;
  884. }
  885. .header-sit{
  886. width:100%;
  887. box-sizing: border-box;
  888. height: 80rpx;
  889. line-height: 80rpx;
  890. box-sizing: border-box;
  891. padding:0 40rpx;
  892. text-align: left;
  893. font-size: $font-size-40;
  894. color: #FFFFFF;
  895. font-weight: 600;
  896. font-family: '正楷';
  897. margin-top: 30rpx;
  898. .iconfont{
  899. font-size: 42rpx;
  900. margin-left: 30rpx;
  901. }
  902. }
  903. .mine{
  904. width: 100%;
  905. height: 100%;
  906. position:relative;
  907. }
  908. .product-content{
  909. width: 100%;
  910. height: auto;
  911. position: relative;
  912. padding:0;
  913. padding-top: 80rpx;
  914. box-sizing: border-box;
  915. .header-tabs{
  916. width: 100%;
  917. height: auto;
  918. margin-bottom: 40rpx;
  919. padding: 20rpx;
  920. border-radius: 20rpx;
  921. background:#4688fa;
  922. box-sizing: border-box;
  923. &.day{
  924. background:#FFFFFF;
  925. padding:40rpx 20rpx;
  926. box-shadow:0px 3px 6px rgba(0,0,0,0.2);
  927. }
  928. .title{
  929. font-size: $font-size-36;
  930. line-height: 60rpx;
  931. color: #FFF;
  932. font-weight: bold;
  933. margin-bottom: 20rpx;
  934. }
  935. .main{
  936. width: 100%;
  937. height: 110rpx;
  938. .main-item{
  939. float: left;
  940. width:20%;
  941. text-align: center;
  942. color: #FFFFFF;
  943. box-sizing: border-box;
  944. &.active{
  945. .iconfont{
  946. color: #576efa;
  947. }
  948. .text{
  949. font-weight: bold;
  950. color:#576efa ;
  951. font-size: $font-size-28;
  952. }
  953. }
  954. .text{
  955. width: 100%;
  956. height:60rpx;
  957. line-height: 60rpx;
  958. display: block;
  959. float: left;
  960. font-size:$font-size-24;
  961. color: #666666;
  962. text-align: center;
  963. &.nm{
  964. color: #222222;
  965. height:40rpx;
  966. line-height: 40rpx;
  967. font-size: $font-size-32;
  968. font-weight: bold;
  969. }
  970. }
  971. .iconfont{
  972. font-size:50rpx;
  973. color: #7aa5fa ;
  974. position: relative;
  975. .badg{
  976. padding: 0 10rpx;
  977. height: 30rpx;
  978. display: inline-block;
  979. font-size: $font-size-24;
  980. text-align: center;
  981. line-height: 30rpx;
  982. background-color: #ff4759;
  983. color: #FFF;
  984. position: absolute;
  985. top: -15rpx;
  986. right:20rpx;
  987. border-radius: 15rpx;
  988. }
  989. }
  990. }
  991. }
  992. }
  993. .tui-header-btm {
  994. width: 100%;
  995. padding: 0 30rpx;
  996. box-sizing: border-box;
  997. display: flex;
  998. align-items: center;
  999. justify-content: space-between;
  1000. color: #fff;
  1001. }
  1002. .tui-btm-item {
  1003. flex: 1;
  1004. display: flex;
  1005. flex-direction: column;
  1006. align-items: center;
  1007. justify-content: center;
  1008. }
  1009. .tui-btm-num {
  1010. font-size: 32rpx;
  1011. font-weight: 600;
  1012. position: relative;
  1013. }
  1014. .tui-btm-text {
  1015. font-size: 24rpx;
  1016. opacity: 0.85;
  1017. padding-top: 4rpx;
  1018. }
  1019. }
  1020. .tui-goods-item {
  1021. display: flex;
  1022. padding: 30rpx 20rpx;
  1023. box-sizing: border-box;
  1024. border-bottom: 1px solid #EBEBEB;
  1025. position: relative;
  1026. }
  1027. .tui-goods-checkBox{
  1028. display: flex;
  1029. align-items: center;
  1030. margin: 0 15rpx;
  1031. .checkbox{
  1032. display: flex;
  1033. margin: 0;
  1034. padding: 0;
  1035. display: flex;
  1036. flex-direction: column;
  1037. align-items: center;
  1038. box-sizing: border-box;
  1039. text-align: center;
  1040. text-decoration: none;
  1041. border-radius: 0;
  1042. -webkit-tap-highlight-color: transparent;
  1043. overflow: hidden;
  1044. background-color:#FFFFFF;
  1045. font-size: 36rpx;
  1046. color:$color-system;
  1047. }
  1048. .text{
  1049. font-size: $font-size-24;
  1050. margin-left: 10rpx;
  1051. }
  1052. }
  1053. .tui-goods-image{
  1054. width: 180rpx;
  1055. height: 180rpx !important;
  1056. border-radius: 12rpx;
  1057. .tui-goods-img {
  1058. width: 180rpx;
  1059. height: 180rpx !important;
  1060. border-radius: 12rpx;
  1061. flex-shrink: 0;
  1062. display: block;
  1063. }
  1064. }
  1065. .tui-goods-info {
  1066. padding-left: 20rpx;
  1067. display: flex;
  1068. flex-direction: column;
  1069. align-items: flex-start;
  1070. justify-content: space-between;
  1071. box-sizing: border-box;
  1072. overflow: hidden;
  1073. position: relative;
  1074. }
  1075. .tui-goods-status{
  1076. width: 160rpx;
  1077. position: absolute;
  1078. right: 0;
  1079. .status-text{
  1080. font-size: $font-size-24;
  1081. line-height: 44rpx;
  1082. text-align: center;
  1083. color: #666666;
  1084. }
  1085. }
  1086. .tui-goods-title {
  1087. white-space: normal;
  1088. word-break: break-all;
  1089. overflow: hidden;
  1090. text-overflow: ellipsis;
  1091. display: -webkit-box;
  1092. -webkit-box-orient: vertical;
  1093. -webkit-line-clamp: 2;
  1094. font-size: 26rpx;
  1095. color: #333;
  1096. line-height: 44rpx;
  1097. }
  1098. .tui-goods-pip{
  1099. white-space: normal;
  1100. word-break: break-all;
  1101. overflow: hidden;
  1102. text-overflow: ellipsis;
  1103. display: -webkit-box;
  1104. -webkit-box-orient: vertical;
  1105. -webkit-line-clamp: 2;
  1106. font-size: 24rpx;
  1107. color: #999;
  1108. line-height: 44rpx;
  1109. .red{
  1110. color: #FF201F;
  1111. }
  1112. }
  1113. .tui-goods-ediet{
  1114. width: 60rpx;
  1115. height: 60rpx;
  1116. background: linear-gradient(90deg,rgba(122,165,250,1) 0%,rgba(87,110,250,1) 100%);
  1117. border-radius: 50%;
  1118. line-height: 60rpx;
  1119. text-align: center;
  1120. position: absolute;
  1121. right: 0;
  1122. top: 50%;
  1123. .icon-bianji1 {
  1124. flex-shrink: 0;
  1125. display: flex;
  1126. align-items: center;
  1127. justify-content: center;
  1128. color: #FFFFFF;
  1129. font-size: 24rpx;
  1130. }
  1131. }
  1132. .tui-goods-model {
  1133. max-width: 100%;
  1134. color: #FFFFFF;
  1135. background: #4688fa;
  1136. border-radius: 40rpx;
  1137. display: flex;
  1138. align-items: center;
  1139. justify-content: space-between;
  1140. padding: 0 20rpx;
  1141. box-sizing: border-box;
  1142. margin-top: 10rpx;
  1143. }
  1144. .tui-model-text {
  1145. max-width: 100%;
  1146. transform: scale(0.9);
  1147. transform-origin: 0 center;
  1148. font-size: 24rpx;
  1149. line-height: 40rpx;
  1150. white-space: nowrap;
  1151. overflow: hidden;
  1152. text-overflow: ellipsis;
  1153. }
  1154. .tui-price-box {
  1155. width: 100%;
  1156. display: flex;
  1157. align-items: flex-end;
  1158. justify-content: space-between;
  1159. }
  1160. .tui-goods-price {
  1161. font-size: $font-size-28;
  1162. font-weight: 500;
  1163. color: #FF201F;
  1164. }
  1165. .tui-popup-box {
  1166. position: relative;
  1167. box-sizing: border-box;
  1168. min-height: 200rpx;
  1169. padding:6rpx 24rpx;
  1170. }
  1171. .tui-popup-btn {
  1172. width: 100%;
  1173. height: auto;
  1174. float: left;
  1175. box-sizing: border-box;
  1176. padding: 0 75rpx;
  1177. margin-top: 30rpx;
  1178. .tui-button{
  1179. width: 600rpx;
  1180. height: 88rpx;
  1181. background: #e1e1e1;
  1182. line-height: 88rpx;
  1183. text-align: center;
  1184. color: #FFFFFF;
  1185. font-size: $font-size-28;
  1186. border-radius: 44rpx;
  1187. &.active{
  1188. background: $btn-confirm;
  1189. }
  1190. }
  1191. }
  1192. </style>