my-product.vue 30 KB

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