my-product.vue 31 KB

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