my-product.vue 30 KB

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