my-product.vue 33 KB

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