my-product.vue 32 KB

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