my-product.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  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">
  10. <view class="checkbox iconfont" :class="[isAllChecked ?'icon-yixuanze':'icon-weixuanze']" @click="isCheckedAll"></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">
  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:9},
  161. {name: '已隐身',value:10},
  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 === '10'){
  276. item.actions = [
  277. {name: '无操作',color: '#fff',fontsize: 26,width: 50,background: '#e1e1e1'},
  278. ]
  279. }else if(item.validFlag === '1' || item.validFlag === '9'){
  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 === '10'){
  317. if(e.index == 0){
  318. return
  319. }
  320. }else if(item.validFlag === '1' || item.validFlag === '9'){
  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. float: left;
  636. color: #666666;
  637. }
  638. .ortext{
  639. float: right;
  640. color: $color-system;
  641. }
  642. }
  643. .superv-header-checked{
  644. width: 100%;
  645. height: 80rpx;
  646. font-size: $font-size-30;
  647. .oltext{
  648. float: left;
  649. color: #666666;
  650. display: flex;
  651. margin-left: 10rpx;
  652. .checkbox{
  653. display: flex;
  654. margin: 0;
  655. padding: 0;
  656. display: flex;
  657. flex-direction: column;
  658. align-items: center;
  659. box-sizing: border-box;
  660. text-align: center;
  661. text-decoration: none;
  662. border-radius: 0;
  663. -webkit-tap-highlight-color: transparent;
  664. overflow: hidden;
  665. font-size: 34rpx;
  666. color:$color-system;
  667. line-height: 80rpx;
  668. }
  669. .text{
  670. float: left;
  671. line-height: 80rpx;
  672. margin-left: 15rpx;
  673. }
  674. }
  675. .ortext{
  676. float: right;
  677. color: $color-system;
  678. }
  679. }
  680. }
  681. .d-container {
  682. width: 560rpx;
  683. padding: 80rpx 30rpx;
  684. .d-title{
  685. width: 100%;
  686. height:80rpx;
  687. line-height: 80rpx;
  688. text-align: center;
  689. color: #4688fa;
  690. font-size: $font-size-32;
  691. float: left;
  692. }
  693. .d-time{
  694. width: 100%;
  695. height: 70rpx;
  696. float: left;
  697. box-sizing: border-box;
  698. padding: 0 10rpx;
  699. border: 1px solid rgba(0,0,0,0.2);
  700. border-radius: 4rpx;
  701. margin-bottom: 30rpx;
  702. .iconfont{
  703. width:70rpx;
  704. height: 60rpx;
  705. display: block;
  706. float: left;
  707. font-size: 50rpx;
  708. color: #666666;
  709. line-height: 70rpx;
  710. text-align: left;
  711. }
  712. .input{
  713. width: 220rpx;
  714. height: 70rpx;
  715. line-height: 70rpx;
  716. float: left;
  717. box-sizing: border-box;
  718. font-size: $font-size-24;
  719. color: #333333;
  720. padding: 0 10rpx;
  721. }
  722. }
  723. .d-label{
  724. width: 100%;
  725. height: 44rpx;
  726. line-height: 44rpx;
  727. text-align: left;
  728. color: #666666;
  729. font-size: $font-size-26;
  730. float: left;
  731. }
  732. .d-input{
  733. width: 100%;
  734. height: 70rpx;
  735. float: left;
  736. box-sizing: border-box;
  737. padding: 0 10rpx;
  738. border: 1px solid rgba(0,0,0,0.2);
  739. border-radius: 4rpx;
  740. margin-bottom: 30rpx;
  741. position: relative;
  742. &.btn{
  743. border: none;
  744. margin-top: 40rpx;
  745. }
  746. .input{
  747. width: 100%;
  748. height: 70rpx;
  749. line-height: 70rpx;
  750. float: left;
  751. box-sizing: border-box;
  752. font-size: $font-size-24;
  753. color: #333333;
  754. padding: 0 10rpx;
  755. padding-right: 68rpx;
  756. }
  757. .iconfont{
  758. width: 50rpx;
  759. height: 68rpx;
  760. display: block;
  761. line-height: 68rpx;
  762. text-align: center;
  763. font-size: 30rpx;
  764. color: #999999;
  765. position: absolute;
  766. right: 0;
  767. top: 0;
  768. }
  769. .d-btn{
  770. width: 210rpx;
  771. height: 84rpx;
  772. border-radius: 42rpx;
  773. background: $btn-confirm;
  774. line-height: 84rpx;
  775. text-align: center;
  776. font-size: $font-size-26;
  777. color: #FFFFFF;
  778. float: right;
  779. &.comfrim{
  780. background: $btn-confirm;
  781. margin-left: 20rpx;
  782. }
  783. &.clear{
  784. background: #e1e1e1;
  785. }
  786. }
  787. }
  788. }
  789. .tui-header {
  790. width: 100%;
  791. font-size: 16px;
  792. font-weight: 500;
  793. height: 32px;
  794. display: flex;
  795. align-items: center;
  796. justify-content: center;
  797. position: relative;
  798. padding: 0 40rpx;
  799. }
  800. .header-sit{
  801. width:100%;
  802. box-sizing: border-box;
  803. height: 80rpx;
  804. line-height: 80rpx;
  805. box-sizing: border-box;
  806. padding:0 40rpx;
  807. text-align: left;
  808. font-size: $font-size-40;
  809. color: #FFFFFF;
  810. font-weight: 600;
  811. font-family: '正楷';
  812. margin-top: 30rpx;
  813. .iconfont{
  814. font-size: 42rpx;
  815. margin-left: 30rpx;
  816. }
  817. }
  818. .mine{
  819. width: 100%;
  820. height: 100%;
  821. position:relative;
  822. }
  823. .product-content{
  824. width: 100%;
  825. height: auto;
  826. position: relative;
  827. padding:0;
  828. padding-top: 80rpx;
  829. box-sizing: border-box;
  830. .header-tabs{
  831. width: 100%;
  832. height: auto;
  833. margin-bottom: 40rpx;
  834. padding: 20rpx;
  835. border-radius: 20rpx;
  836. background:#4688fa;
  837. box-sizing: border-box;
  838. &.day{
  839. background:#FFFFFF;
  840. padding:40rpx 20rpx;
  841. box-shadow:0px 3px 6px rgba(0,0,0,0.2);
  842. }
  843. .title{
  844. font-size: $font-size-36;
  845. line-height: 60rpx;
  846. color: #FFF;
  847. font-weight: bold;
  848. margin-bottom: 20rpx;
  849. }
  850. .main{
  851. width: 100%;
  852. height: 110rpx;
  853. .main-item{
  854. float: left;
  855. width:20%;
  856. text-align: center;
  857. color: #FFFFFF;
  858. box-sizing: border-box;
  859. &.active{
  860. .iconfont{
  861. color: #576efa;
  862. }
  863. .text{
  864. font-weight: bold;
  865. color:#576efa ;
  866. font-size: $font-size-28;
  867. }
  868. }
  869. .text{
  870. width: 100%;
  871. height:60rpx;
  872. line-height: 60rpx;
  873. display: block;
  874. float: left;
  875. font-size:$font-size-24;
  876. color: #666666;
  877. text-align: center;
  878. &.nm{
  879. color: #222222;
  880. height:40rpx;
  881. line-height: 40rpx;
  882. font-size: $font-size-32;
  883. font-weight: bold;
  884. }
  885. }
  886. .iconfont{
  887. font-size:50rpx;
  888. color: #7aa5fa ;
  889. position: relative;
  890. .badg{
  891. padding: 0 10rpx;
  892. height: 30rpx;
  893. display: inline-block;
  894. font-size: $font-size-24;
  895. text-align: center;
  896. line-height: 30rpx;
  897. background-color: #ff4759;
  898. color: #FFF;
  899. position: absolute;
  900. top: -15rpx;
  901. right:20rpx;
  902. border-radius: 15rpx;
  903. }
  904. }
  905. }
  906. }
  907. }
  908. .tui-header-btm {
  909. width: 100%;
  910. padding: 0 30rpx;
  911. box-sizing: border-box;
  912. display: flex;
  913. align-items: center;
  914. justify-content: space-between;
  915. color: #fff;
  916. }
  917. .tui-btm-item {
  918. flex: 1;
  919. display: flex;
  920. flex-direction: column;
  921. align-items: center;
  922. justify-content: center;
  923. }
  924. .tui-btm-num {
  925. font-size: 32rpx;
  926. font-weight: 600;
  927. position: relative;
  928. }
  929. .tui-btm-text {
  930. font-size: 24rpx;
  931. opacity: 0.85;
  932. padding-top: 4rpx;
  933. }
  934. }
  935. .tui-goods-item {
  936. display: flex;
  937. padding: 30rpx 20rpx;
  938. box-sizing: border-box;
  939. border-bottom: 1px solid #EBEBEB;
  940. position: relative;
  941. }
  942. .tui-goods-checkBox{
  943. display: flex;
  944. align-items: center;
  945. margin: 0 15rpx;
  946. .checkbox{
  947. display: flex;
  948. margin: 0;
  949. padding: 0;
  950. display: flex;
  951. flex-direction: column;
  952. align-items: center;
  953. box-sizing: border-box;
  954. text-align: center;
  955. text-decoration: none;
  956. border-radius: 0;
  957. -webkit-tap-highlight-color: transparent;
  958. overflow: hidden;
  959. background-color:#FFFFFF;
  960. font-size: 36rpx;
  961. color:$color-system;
  962. }
  963. .text{
  964. font-size: $font-size-24;
  965. margin-left: 10rpx;
  966. }
  967. }
  968. .tui-goods-image{
  969. width: 180rpx;
  970. height: 180rpx !important;
  971. border-radius: 12rpx;
  972. .tui-goods-img {
  973. width: 180rpx;
  974. height: 180rpx !important;
  975. border-radius: 12rpx;
  976. flex-shrink: 0;
  977. display: block;
  978. }
  979. }
  980. .tui-goods-info {
  981. width: 360rpx;
  982. padding-left: 20rpx;
  983. display: flex;
  984. flex-direction: column;
  985. align-items: flex-start;
  986. justify-content: space-between;
  987. box-sizing: border-box;
  988. overflow: hidden;
  989. position: relative;
  990. }
  991. .tui-goods-status{
  992. width: 160rpx;
  993. position: absolute;
  994. right: 0;
  995. .status-text{
  996. font-size: $font-size-24;
  997. line-height: 44rpx;
  998. text-align: center;
  999. color: #666666;
  1000. }
  1001. }
  1002. .tui-goods-title {
  1003. white-space: normal;
  1004. word-break: break-all;
  1005. overflow: hidden;
  1006. text-overflow: ellipsis;
  1007. display: -webkit-box;
  1008. -webkit-box-orient: vertical;
  1009. -webkit-line-clamp: 2;
  1010. font-size: 26rpx;
  1011. color: #333;
  1012. line-height: 44rpx;
  1013. }
  1014. .tui-goods-pip{
  1015. white-space: normal;
  1016. word-break: break-all;
  1017. overflow: hidden;
  1018. text-overflow: ellipsis;
  1019. display: -webkit-box;
  1020. -webkit-box-orient: vertical;
  1021. -webkit-line-clamp: 2;
  1022. font-size: 24rpx;
  1023. color: #999;
  1024. line-height: 44rpx;
  1025. }
  1026. .tui-goods-ediet{
  1027. width: 60rpx;
  1028. height: 60rpx;
  1029. background: linear-gradient(90deg,rgba(122,165,250,1) 0%,rgba(87,110,250,1) 100%);
  1030. border-radius: 50%;
  1031. line-height: 60rpx;
  1032. text-align: center;
  1033. position: absolute;
  1034. right: 0;
  1035. top: 50%;
  1036. .icon-bianji1 {
  1037. flex-shrink: 0;
  1038. display: flex;
  1039. align-items: center;
  1040. justify-content: center;
  1041. color: #FFFFFF;
  1042. font-size: 24rpx;
  1043. }
  1044. }
  1045. .tui-goods-model {
  1046. max-width: 100%;
  1047. color: #FFFFFF;
  1048. background: #4688fa;
  1049. border-radius: 40rpx;
  1050. display: flex;
  1051. align-items: center;
  1052. justify-content: space-between;
  1053. padding: 0 20rpx;
  1054. box-sizing: border-box;
  1055. margin-top: 10rpx;
  1056. }
  1057. .tui-model-text {
  1058. max-width: 100%;
  1059. transform: scale(0.9);
  1060. transform-origin: 0 center;
  1061. font-size: 24rpx;
  1062. line-height: 40rpx;
  1063. white-space: nowrap;
  1064. overflow: hidden;
  1065. text-overflow: ellipsis;
  1066. }
  1067. .tui-price-box {
  1068. width: 100%;
  1069. display: flex;
  1070. align-items: flex-end;
  1071. justify-content: space-between;
  1072. }
  1073. .tui-goods-price {
  1074. font-size: $font-size-28;
  1075. font-weight: 500;
  1076. color: #FF201F;
  1077. }
  1078. .tui-popup-box {
  1079. position: relative;
  1080. box-sizing: border-box;
  1081. min-height: 200rpx;
  1082. padding:6rpx 24rpx;
  1083. }
  1084. .tui-popup-btn {
  1085. width: 100%;
  1086. height: auto;
  1087. float: left;
  1088. box-sizing: border-box;
  1089. padding: 0 75rpx;
  1090. margin-top: 30rpx;
  1091. .tui-button{
  1092. width: 600rpx;
  1093. height: 88rpx;
  1094. background: #e1e1e1;
  1095. line-height: 88rpx;
  1096. text-align: center;
  1097. color: #FFFFFF;
  1098. font-size: $font-size-28;
  1099. border-radius: 44rpx;
  1100. &.active{
  1101. background: $btn-confirm;
  1102. }
  1103. }
  1104. }
  1105. </style>