my-product.vue 31 KB

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