my-product.vue 33 KB

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