my-product.vue 32 KB

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