index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
  4. <view class="C1b1b1b">
  5. <tm-search @click="sosoFun" disabled="true" v-model="soso" color="white" confirm-text=""></tm-search>
  6. <view class="dingwei" v-if="itemuser!=0">
  7. <image class="touxiang" style="vertical-align: middle;" src="/static/img/41.png" mode="widthFix"></image>
  8. <text style="vertical-align: middle;" class="text-size-m mr-20">{{itemuser.username}}的衣橱</text>
  9. <image @click="qiehuanFun" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
  10. <text @click="qiehuanFun" style="vertical-align: middle;" class="text-size-m">切换</text>
  11. <tm-button class="fr mt-20" theme="primary" size="s" @click="luru">衣服录入</tm-button>
  12. </view>
  13. <view class="dingwei" v-if="itemuser==0">
  14. <text style="vertical-align: middle;" class="text-size-m mr-20">暂无家庭成员去添加</text>
  15. <image @click="chuangjian" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
  16. </view>
  17. </view>
  18. <!-- 推荐 -->
  19. <view class="zhuti">
  20. <div>
  21. <tm-sheet class="lunbo1 fl" v-for="item in quanbuchang">
  22. <view class="flex-between flex-center">
  23. <view class="tuijian">
  24. <text class="text-white text-size-lg">{{item.title}}</text>
  25. </view>
  26. <!-- <view >
  27. <text class="text-size-s C929297">详情</text>
  28. </view> -->
  29. </view>
  30. <view class="flex-between flex-center mt-20 pa-8" style="border-radius: 4px;" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  31. <view class="tuijiantp" v-for="item1 in item.info" @click="tiao(item1.id)">
  32. <image style="vertical-align: middle;" :src="item1.image" mode="widthFix"></image>
  33. </view>
  34. <!-- <view class="tuijiantp">
  35. <image class="fr" style="vertical-align: middle;" src="/static/img/44.png" mode="widthFix"></image>
  36. </view> -->
  37. </view>
  38. </tm-sheet>
  39. <!-- <tm-sheet class="lunbo1 fr">
  40. <view class="flex-between flex-center">
  41. <view class="tuijian">
  42. <text class="text-white text-size-lg">日常出勤</text>
  43. </view>
  44. <view >
  45. <text class="text-size-s C929297">详情</text>
  46. </view>
  47. </view>
  48. <view class="flex-between flex-center mt-20 pa-8" style="border-radius: 4px;" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  49. <view class="tuijiantp">
  50. <image style="vertical-align: middle;" src="/static/img/43.png" mode="widthFix"></image>
  51. </view>
  52. <view class="tuijiantp">
  53. <image class="fr" style="vertical-align: middle;" src="/static/img/44.png" mode="widthFix"></image>
  54. </view>
  55. </view>
  56. </tm-sheet> -->
  57. <view style="clear: both;"></view>
  58. </div>
  59. <!-- 衣橱 -->
  60. <tm-sheet class="yichu" style="margin-bottom: 70px !important;">
  61. <tm-tabs class="C1b1b1b qiehuan" @change="fenleichangeFun" color="white" align="left" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
  62. <view class="pa-10 text-size-s">柜中{{have}}件 共{{total}}条</view>
  63. <view style="position: relative;" class="yiguicla black pa-6 ma-4 fl" v-for="(item,index) in quanbuList" @longtap="longtap()" @click="xiangqing(item)">
  64. <image :src="item.image" mode="widthFix"></image>
  65. <view class="text-align-center text-size-m mt-8">{{item.brand}}</view>
  66. <view class="text-align-center text-size-m mt-6 mb-6">{{item.goods_name}}</view>
  67. <view v-if="item.is_have==0" class="hui"></view>
  68. </view>
  69. <view style="clear: both;"></view>
  70. <tm-empty v-if="wushuju" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
  71. <view v-if="total>quanbuList.length" style="clear: both;" class="more ma-40 pt-40" @click="gengmore()">
  72. <image src="/static/img/30.png" mode="widthFix"></image>
  73. <text class="text-size-s">下拉加载更多~</text>
  74. </view>
  75. </tm-sheet>
  76. </view>
  77. <!-- 待取衣服 -->
  78. <tm-flotbutton class="qiu" @change="anniu" show-actions position="bottomRight" actions-pos="top" label="" :show-text="true"
  79. :actions="listqiu">
  80. </tm-flotbutton>
  81. <!-- <css-float-ball v-model="floatBallPosition" >
  82. <view class="float-ball-icon" hover-class="default-icon-hover">
  83. <tm-translate ref="a_1" :auto="true" animation-name="fadeLeft">
  84. <view class="fudong" @click="show_1=true">
  85. <image src="/static/img/96.png" class="fudimg fl"></image>
  86. <view class="pt-20">待取衣物</view>
  87. <view>(<text style="color: #FFCC00;">3</text>件)</view>
  88. </view>
  89. </tm-translate>
  90. </view>
  91. </css-float-ball> -->
  92. <!-- 弹出 -->
  93. <tm-poup v-model="show_1" :position="pos" class="tcc">
  94. <view style="position: relative !important;" v-if="chukudata.length !=0">
  95. <view style="height: 10px;"></view>
  96. <tm-swiper @change="qiehuanLb" :current="current" :indicator-dots="false" :round="6" :ani3d="190" :autoplay="false" :list="list1"></tm-swiper>
  97. <view class="text-white text-align-center mt-15">{{chukudata[current].brand}}{{chukudata[current].color}}{{chukudata[current].goods_name}}</view>
  98. <view class="text-white text-align-center mt-10 text-size-s">{{chukudata[current].description}}</view>
  99. <image class="guayi" :src="chukudata[current].ygimage" mode="widthFix"></image>
  100. <view class="text-white text-align-center mt-15">衣物位于 {{chukudata[current].ygposition}} {{chukudata[current].is_have}}号衣柜</view>
  101. <view class="text-white text-align-center mt-15">
  102. <image class="aniOn deng" src="/static/img/101.png" mode="widthFix"></image>
  103. <text style="vertical-align: middle;">指示灯已亮,请取出衣柜</text>
  104. </view>
  105. <view class="anniu">
  106. <tm-button @click="quxiao()" theme="gray" size="n">关闭弹框</tm-button>
  107. <tm-button @click="chuFun()" class="fr" theme="primary" size="n">取消出库</tm-button>
  108. </view>
  109. </view>
  110. </tm-poup>
  111. <!-- 弹出层消息 -->
  112. <tm-message ref="toast"></tm-message>
  113. </view>
  114. </template>
  115. <script>
  116. import{myRequest} from '@/api/request.js'
  117. export default {
  118. data() {
  119. return {
  120. listqiu:[],
  121. wushuju:false,
  122. gengduo:false,
  123. offset: [0, 0],
  124. show_1:false,
  125. pos:'center',
  126. floatBallPosition:{x: 400, y: 750},
  127. itemuser:0,
  128. soso:'',
  129. activeIndex:0,
  130. list:[],
  131. listlx:[],
  132. quanbuList:[],
  133. list1:[],
  134. pagesize:9,
  135. page:1,
  136. total:0,
  137. count:0,
  138. have:0,
  139. chukudata:[],
  140. current:0,
  141. qiuid:'',
  142. quanbuchang:[]
  143. };
  144. },
  145. onLoad(e) {
  146. this.offset = [16, 99]
  147. if(!uni.getStorageSync("token")){
  148. uni.navigateTo({
  149. url: "/pages/login/index",
  150. })
  151. }
  152. },
  153. onShow(){
  154. this.sys = uni.getSystemInfoSync();
  155. this.getQiu()
  156. this.fenleichange();
  157. this.getfenltext();
  158. },
  159. created() {
  160. },
  161. methods: {
  162. shuaxin(){
  163. // console.log(99999)
  164. // this.quanbuList=[];
  165. // this.fenleichange();
  166. // this.getfenltext();
  167. },
  168. qiehuanLb(e){
  169. var that=this;
  170. this.current=e;
  171. },
  172. anniu(e){
  173. var that=this;
  174. console.log(this.chukudata)
  175. that.qiuid=that.listqiu[e].id;
  176. myRequest({
  177. url: "/api/Goods/getBallClothing",
  178. method:'post',
  179. data:{id:that.qiuid}
  180. }).then(res => {
  181. if (res.data.code == 200) {
  182. that.current=0;
  183. that.show_1=true;
  184. that.chukudata=res.data.data;
  185. that.list1=[];
  186. for(let i=0;i<res.data.data.length;i++){
  187. that.list1.push(res.data.data[i].image)
  188. }
  189. }else{
  190. }
  191. })
  192. },
  193. getQiu(){
  194. var that=this;
  195. myRequest({
  196. url: "/api/Goods/getBall",
  197. method:'post',
  198. data:{}
  199. }).then(res => {
  200. if (res.data.code == 200) {
  201. if(res.data.data.length != 0){
  202. that.listqiu=res.data.data;
  203. for(let i=0;i<that.listqiu.length;i++){
  204. that.listqiu[i]["icon"]='/static/img/96.png'
  205. }
  206. }
  207. }else{
  208. that.listqiu=[];
  209. }
  210. })
  211. },
  212. getList(){
  213. var that=this;
  214. myRequest({
  215. url: "/api/Goods/classificationData",
  216. method:'post',
  217. data:{role_id:that.itemuser.id,id:that.activeIndex,page:that.page,pagesize:that.pagesize}
  218. }).then(res => {
  219. if (res.data.code == 200) {
  220. that.quanbuchang=res.data.data.chang;
  221. that.quanbuList=that.quanbuList.concat(res.data.data.data);
  222. if(that.quanbuList.length==0){
  223. that.wushuju=true
  224. }else{
  225. that.wushuju=false
  226. }
  227. that.total=res.data.data.total;
  228. that.count=res.data.data.count;
  229. that.have=res.data.data.have;
  230. }else{
  231. that.quanbuList=[];
  232. if(that.quanbuList.length==0){
  233. that.wushuju=true
  234. }
  235. }
  236. })
  237. },
  238. quxiao(){
  239. this.show_1=false;
  240. },
  241. chuFun(){
  242. var that=this;
  243. myRequest({
  244. url: "/api/Goods/cancelDelivery",
  245. method:'post',
  246. data:{qiu_id:that.qiuid,id:that.chukudata[that.current].id}
  247. }).then(res => {
  248. console.log(res.data)
  249. if (res.data.code == 200) {
  250. that.show_1=false;
  251. that.getQiu()
  252. that.$refs.toast.show({model:'success',label:res.data.msg})
  253. }else{
  254. that.$refs.toast.show({model:'error',label:res.data.msg})
  255. }
  256. })
  257. },
  258. chuangjian(){
  259. uni.navigateTo({
  260. url: "/pages/chuanghome/index",
  261. })
  262. },
  263. longtap(){
  264. uni.navigateTo({
  265. url: "/pages/changan/index",
  266. })
  267. },
  268. tiao(id){
  269. uni.navigateTo({
  270. url: "/pages/zidingyikan/index?id="+id+"&type=1",
  271. })
  272. },
  273. xiangqing(item){
  274. uni.navigateTo({
  275. url: "/pages/yifu/index?id="+item.id,
  276. })
  277. },
  278. fenleichangeFun(){
  279. this.page=1;
  280. this.quanbuList=[]
  281. this.getList()
  282. },
  283. sosoFun(){
  284. uni.navigateTo({
  285. url: "/pages/sousuo/index",
  286. })
  287. },
  288. fenleichange(){
  289. var that=this;
  290. console.log("11199")
  291. myRequest({
  292. url: "/api/MemberInfo/getFamilyMember",
  293. method:'post',
  294. data:{family_id:uni.getStorageSync("family_id")}
  295. }).then(res => {
  296. if (res.data.code == 200) {
  297. if(res.data.data.length != 0){
  298. var wu=0;
  299. for(let i=0;i<res.data.data.length;i++){
  300. if(res.data.data[i].checked==1){
  301. wu=1;
  302. that.itemuser=res.data.data[i];
  303. }
  304. }
  305. if(wu==0){
  306. that.itemuser=res.data.data[0];
  307. }
  308. that.quanbuList=[];
  309. this.getList()
  310. }else{
  311. that.itemuser=0;
  312. }
  313. }else{
  314. that.itemuser=0;
  315. }
  316. })
  317. },
  318. getfenltext(){
  319. var that=this;
  320. myRequest({
  321. url: "/api/Category/list",
  322. method:'post',
  323. data:{}
  324. }).then(res => {
  325. if (res.data.code == 200) {
  326. if(res.data.data.length != 0){
  327. that.list=['全部'];
  328. for(let i=0;i<res.data.data.length;i++){
  329. that.list.push(res.data.data[i].category_name)
  330. }
  331. that.listlx=res.data.data;
  332. }
  333. }else{
  334. that.list=[];
  335. that.listlx=[];
  336. }
  337. })
  338. },
  339. qiehuanFun(){
  340. uni.navigateTo({
  341. url: "/pages/qiehuan/index",
  342. })
  343. },
  344. gengmore(){
  345. this.page=this.page+1;
  346. this.getList();
  347. },
  348. luru(){
  349. uni.navigateTo({
  350. url: "/pages/luru/index",
  351. })
  352. }
  353. },
  354. }
  355. </script>
  356. <style lang="scss">
  357. /deep/ uni-scroll-view{
  358. height: auto !important;
  359. }
  360. /deep/ .tm-menubars .body{
  361. background-color: #1b1b1b !important;
  362. }
  363. .shangright{
  364. padding: 10px;
  365. }
  366. //
  367. .xiangji image{
  368. width: 30px;
  369. height: 22px;
  370. }
  371. .suosou image{
  372. width: 40px;
  373. }
  374. /deep/ .icon-search{
  375. font-size: 23px !important;
  376. color: #8E8E93 !important;
  377. }
  378. /deep/ .tm-search{
  379. width: 94%;
  380. margin: 0 auto;
  381. background-color: #414141 !important;
  382. border-radius: 10px;
  383. }
  384. /deep/ .tm-search .grey-darken-5{
  385. background-color: #414141 !important;
  386. }
  387. .dingwei{width: 92%;margin: 0 auto;margin-top: 20px;padding-bottom: 20px;}
  388. .dingwei image{width: 25px;margin-right: 10px; }
  389. .dingwei .touxiang{width: 50px;margin-right: 3px; }
  390. /deep/ .lunbo1{margin:0 !important;padding: 4px !important;margin-top: 5px !important;width: 46.6% !important;}
  391. .tuijiantp{width: 100%;}
  392. .tuijiantp image{width: 76px !important;height: 76px !important;}
  393. .yichu{margin:0 !important;padding: 4px !important;margin-top: 10px !important;min-height: 235px !important;}
  394. /deep/ .qiehuan .text-white{
  395. font-size: 14px;
  396. background: #303440;
  397. height: 28px;
  398. vertical-align: middle;
  399. line-height: 28px;
  400. border-radius: 20px;
  401. padding-left: 14px;
  402. padding-right: 14px;
  403. margin-top: 17%;
  404. }
  405. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  406. .yiguicla image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;height: 90px;}
  407. .yiguicla{width: 30%;border-radius: 10px;height: 130px;overflow: hidden;}
  408. .more{text-align: center;}
  409. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  410. .fudong{position:fixed;right:10px;bottom:150px;background: #303030;width: 130px;height: 60px;
  411. border-radius: 30px 0px 0px 30px;font-size: 14px;text-align: center;}
  412. .fudimg{width: 60px;height:60px}
  413. /deep/ .tcc .tm-poup-wk{width: 90% !important;position:relative;height: 580px !important;}
  414. /deep/ .tcc .uni-swiper-slides{width: 100%;}
  415. /deep/ .tcc uni-swiper{width: 100% !important;}
  416. /deep/ .uni-swiper-slides{width: 160px !important;}
  417. /deep/ .tcc uni-image{width: 160px !important;}
  418. .tcc .guayi{width: 70% !important;display: block;margin:0 auto;margin-top:15px !important;}
  419. .tcc .deng{width:25px !important;height:25px !important;vertical-align: middle;margin-right:8px;}
  420. .anniu{width: 80%;margin: 0 auto;margin-top: 20px;}
  421. /deep/ .anniu .gray.bk{color: white !important;}
  422. .aniOn{
  423. animation:doudong 0.5s linear infinite;
  424. background:linear-gradient();
  425. background: -webkit-linear-gradient();
  426. }
  427. @keyframes doudong {
  428. 0%{
  429. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  430. }
  431. 25%{
  432. transform: rotate(0deg) translateX(-2rpx) translateY(-2rpx);
  433. }
  434. 50%{
  435. transform: rotate(0deg) translateX(0rpx) translateY(-2rpx);
  436. }
  437. 75%{
  438. transform: rotate(0deg) translateX(0rpx) translateY(2rpx);
  439. }
  440. 100%{
  441. transform: rotate(-2deg) translateX(2rpx) translateY(2rpx);
  442. }
  443. }
  444. /deep/ .qiu .flex-center{width: 45px !important;height:45px !important;background: none !important;}
  445. /deep/ .qiu .flex-center uni-image{width: 45px !important;height:45px !important;}
  446. /deep/ .showValue{display: none !important;}
  447. /deep/ .menulistAction{height: 350px;overflow: auto;}
  448. /deep/ .hui{position: absolute;background: rgba(0,0,0,0.4);z-index: 1;top: 0;left: 0;width: 100%;height: 100%;}
  449. </style>